1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QSCATTERSERIES_H
5#define QSCATTERSERIES_H
6
7#include <QtCharts/QChartGlobal>
8#include <QtCharts/qxyseries.h>
9
10QT_BEGIN_NAMESPACE
11
12class QScatterSeriesPrivate;
13
14class Q_CHARTS_EXPORT QScatterSeries : public QXYSeries
15{
16 Q_OBJECT
17 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
18 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
19 Q_PROPERTY(MarkerShape markerShape READ markerShape WRITE setMarkerShape NOTIFY markerShapeChanged)
20 Q_PROPERTY(qreal markerSize READ markerSize WRITE setMarkerSize NOTIFY markerSizeChanged)
21 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
22 Q_ENUMS(MarkerShape)
23
24public:
25 enum MarkerShape {
26 MarkerShapeCircle,
27 MarkerShapeRectangle,
28 MarkerShapeRotatedRectangle,
29 MarkerShapeTriangle,
30 MarkerShapeStar,
31 MarkerShapePentagon
32 };
33
34public:
35 explicit QScatterSeries(QObject *parent = nullptr);
36 ~QScatterSeries();
37 QAbstractSeries::SeriesType type() const override;
38 void setPen(const QPen &pen) override;
39 void setBrush(const QBrush &brush) override;
40 QBrush brush() const;
41 void setColor(const QColor &color) override;
42 QColor color() const override;
43 void setBorderColor(const QColor &color);
44 QColor borderColor() const;
45 MarkerShape markerShape() const;
46 void setMarkerShape(MarkerShape shape);
47 qreal markerSize() const;
48 void setMarkerSize(qreal size);
49
50Q_SIGNALS:
51 void colorChanged(QColor color);
52 void borderColorChanged(QColor color);
53 void markerShapeChanged(MarkerShape shape);
54 void markerSizeChanged(qreal size);
55
56private:
57 Q_DECLARE_PRIVATE(QScatterSeries)
58 Q_DISABLE_COPY(QScatterSeries)
59 friend class ScatterChartItem;
60};
61
62QT_END_NAMESPACE
63
64#endif // QSCATTERSERIES_H
65

source code of qtcharts/src/charts/scatterchart/qscatterseries.h