@@ -1,110 +1,106 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2014 Digia Plc |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
8 | 8 | ** |
|
9 | 9 | ** $QT_BEGIN_LICENSE$ |
|
10 | 10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
11 | 11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
12 | 12 | ** Software or, alternatively, in accordance with the terms contained in |
|
13 | 13 | ** a written agreement between you and Digia. |
|
14 | 14 | ** |
|
15 | 15 | ** If you have questions regarding the use of this file, please use |
|
16 | 16 | ** contact form at http://qt.digia.com |
|
17 | 17 | ** $QT_END_LICENSE$ |
|
18 | 18 | ** |
|
19 | 19 | ****************************************************************************/ |
|
20 | 20 | |
|
21 | 21 | #ifndef QAREASERIES_H |
|
22 | 22 | #define QAREASERIES_H |
|
23 | 23 | |
|
24 | 24 | #include <qchartglobal.h> |
|
25 | 25 | #include <qabstractseries.h> |
|
26 | 26 | #include <QPen> |
|
27 | 27 | #include <QBrush> |
|
28 | 28 | |
|
29 | 29 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
30 | 30 | class QLineSeries; |
|
31 | 31 | class QAreaSeriesPrivate; |
|
32 | 32 | |
|
33 | 33 | class QTCOMMERCIALCHART_EXPORT QAreaSeries : public QAbstractSeries |
|
34 | 34 | { |
|
35 | 35 | Q_OBJECT |
|
36 | 36 | Q_PROPERTY(QLineSeries *upperSeries READ upperSeries) |
|
37 | 37 | Q_PROPERTY(QLineSeries *lowerSeries READ lowerSeries) |
|
38 | 38 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) |
|
39 | 39 | Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged) |
|
40 | Q_PROPERTY(QString pointLabelsFormat READ pointLabelsFormat WRITE setPointLabelsFormat | |
|
41 | NOTIFY pointLabelsFormatChanged) | |
|
42 |
Q_PROPERTY( |
|
|
43 | NOTIFY pointLabelsVisibilityChanged) | |
|
44 | Q_PROPERTY(QFont pointLabelsFont READ pointLabelsFont WRITE setPointLabelsFont | |
|
45 | NOTIFY pointLabelsFontChanged) | |
|
46 | Q_PROPERTY(QColor pointLabelsColor READ pointLabelsColor WRITE setPointLabelsColor | |
|
47 | NOTIFY pointLabelsColorChanged) | |
|
40 | Q_PROPERTY(QString pointLabelsFormat READ pointLabelsFormat WRITE setPointLabelsFormat NOTIFY pointLabelsFormatChanged) | |
|
41 | Q_PROPERTY(bool pointLabelsVisible READ pointLabelsVisible WRITE setPointLabelsVisible NOTIFY pointLabelsVisibilityChanged) | |
|
42 | Q_PROPERTY(QFont pointLabelsFont READ pointLabelsFont WRITE setPointLabelsFont NOTIFY pointLabelsFontChanged) | |
|
43 | Q_PROPERTY(QColor pointLabelsColor READ pointLabelsColor WRITE setPointLabelsColor NOTIFY pointLabelsColorChanged) | |
|
48 | 44 | |
|
49 | 45 | public: |
|
50 | 46 | explicit QAreaSeries(QObject *parent = 0); |
|
51 | 47 | explicit QAreaSeries(QLineSeries *upperSeries, QLineSeries *lowerSeries = 0); |
|
52 | 48 | ~QAreaSeries(); |
|
53 | 49 | |
|
54 | 50 | public: |
|
55 | 51 | QAbstractSeries::SeriesType type() const; |
|
56 | 52 | |
|
57 | 53 | void setUpperSeries(QLineSeries *series); |
|
58 | 54 | QLineSeries *upperSeries() const; |
|
59 | 55 | void setLowerSeries(QLineSeries *series); |
|
60 | 56 | QLineSeries *lowerSeries() const; |
|
61 | 57 | |
|
62 | 58 | void setPen(const QPen &pen); |
|
63 | 59 | QPen pen() const; |
|
64 | 60 | |
|
65 | 61 | void setBrush(const QBrush &brush); |
|
66 | 62 | QBrush brush() const; |
|
67 | 63 | |
|
68 | 64 | void setColor(const QColor &color); |
|
69 | 65 | QColor color() const; |
|
70 | 66 | |
|
71 | 67 | void setBorderColor(const QColor &color); |
|
72 | 68 | QColor borderColor() const; |
|
73 | 69 | |
|
74 | 70 | void setPointsVisible(bool visible = true); |
|
75 | 71 | bool pointsVisible() const; |
|
76 | 72 | |
|
77 | 73 | void setPointLabelsFormat(const QString &format); |
|
78 | 74 | QString pointLabelsFormat() const; |
|
79 | 75 | |
|
80 | 76 | void setPointLabelsVisible(bool visible = true); |
|
81 | 77 | bool pointLabelsVisible() const; |
|
82 | 78 | |
|
83 | 79 | void setPointLabelsFont(const QFont &font); |
|
84 | 80 | QFont pointLabelsFont() const; |
|
85 | 81 | |
|
86 | 82 | void setPointLabelsColor(const QColor &color); |
|
87 | 83 | QColor pointLabelsColor() const; |
|
88 | 84 | |
|
89 | 85 | Q_SIGNALS: |
|
90 | 86 | void clicked(const QPointF &point); |
|
91 | 87 | void hovered(const QPointF &point, bool state); |
|
92 | 88 | void selected(); |
|
93 | 89 | void colorChanged(QColor color); |
|
94 | 90 | void borderColorChanged(QColor color); |
|
95 | 91 | void pointLabelsFormatChanged(const QString &format); |
|
96 | 92 | void pointLabelsVisibilityChanged(bool visible); |
|
97 | 93 | void pointLabelsFontChanged(const QFont &font); |
|
98 | 94 | void pointLabelsColorChanged(const QColor &color); |
|
99 | 95 | |
|
100 | 96 | private: |
|
101 | 97 | Q_DECLARE_PRIVATE(QAreaSeries) |
|
102 | 98 | Q_DISABLE_COPY(QAreaSeries) |
|
103 | 99 | friend class AreaLegendMarker; |
|
104 | 100 | friend class AreaChartItem; |
|
105 | 101 | friend class QAreaLegendMarkerPrivate; |
|
106 | 102 | }; |
|
107 | 103 | |
|
108 | 104 | QTCOMMERCIALCHART_END_NAMESPACE |
|
109 | 105 | |
|
110 | 106 | #endif // QAREASERIES_H |
@@ -1,107 +1,105 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2014 Digia Plc |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
8 | 8 | ** |
|
9 | 9 | ** $QT_BEGIN_LICENSE$ |
|
10 | 10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
11 | 11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
12 | 12 | ** Software or, alternatively, in accordance with the terms contained in |
|
13 | 13 | ** a written agreement between you and Digia. |
|
14 | 14 | ** |
|
15 | 15 | ** If you have questions regarding the use of this file, please use |
|
16 | 16 | ** contact form at http://qt.digia.com |
|
17 | 17 | ** $QT_END_LICENSE$ |
|
18 | 18 | ** |
|
19 | 19 | ****************************************************************************/ |
|
20 | 20 | |
|
21 | 21 | #ifndef QABSTRACTBARSERIES_H |
|
22 | 22 | #define QABSTRACTBARSERIES_H |
|
23 | 23 | |
|
24 | 24 | #include <qabstractseries.h> |
|
25 | 25 | #include <QStringList> |
|
26 | 26 | |
|
27 | 27 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
28 | 28 | |
|
29 | 29 | class QBarSet; |
|
30 | 30 | class QAbstractBarSeriesPrivate; |
|
31 | 31 | |
|
32 | 32 | // Container for series |
|
33 | 33 | class QTCOMMERCIALCHART_EXPORT QAbstractBarSeries : public QAbstractSeries |
|
34 | 34 | { |
|
35 | 35 | Q_OBJECT |
|
36 | 36 | Q_PROPERTY(qreal barWidth READ barWidth WRITE setBarWidth) |
|
37 | 37 | Q_PROPERTY(int count READ count NOTIFY countChanged) |
|
38 | 38 | Q_PROPERTY(bool labelsVisible READ isLabelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged) |
|
39 | Q_PROPERTY(QString labelsFormat READ labelsFormat WRITE setLabelsFormat | |
|
40 | NOTIFY labelsFormatChanged) | |
|
41 | Q_PROPERTY(LabelsPosition labelsPosition READ labelsPosition | |
|
42 | WRITE setLabelsPosition NOTIFY labelsPositionChanged) | |
|
39 | Q_PROPERTY(QString labelsFormat READ labelsFormat WRITE setLabelsFormat NOTIFY labelsFormatChanged) | |
|
40 | Q_PROPERTY(LabelsPosition labelsPosition READ labelsPosition WRITE setLabelsPosition NOTIFY labelsPositionChanged) | |
|
43 | 41 | Q_ENUMS(LabelsPosition) |
|
44 | 42 | |
|
45 | 43 | public: |
|
46 | 44 | enum LabelsPosition { |
|
47 | 45 | LabelsCenter = 0, |
|
48 | 46 | LabelsInsideEnd, |
|
49 | 47 | LabelsInsideBase, |
|
50 | 48 | LabelsOutsideEnd |
|
51 | 49 | }; |
|
52 | 50 | |
|
53 | 51 | public: |
|
54 | 52 | virtual ~QAbstractBarSeries(); |
|
55 | 53 | |
|
56 | 54 | void setBarWidth(qreal width); |
|
57 | 55 | qreal barWidth() const; |
|
58 | 56 | |
|
59 | 57 | bool append(QBarSet *set); |
|
60 | 58 | bool remove(QBarSet *set); |
|
61 | 59 | bool take(QBarSet *set); |
|
62 | 60 | bool append(QList<QBarSet *> sets); |
|
63 | 61 | bool insert(int index, QBarSet *set); |
|
64 | 62 | int count() const; |
|
65 | 63 | QList<QBarSet *> barSets() const; |
|
66 | 64 | void clear(); |
|
67 | 65 | |
|
68 | 66 | void setLabelsVisible(bool visible = true); |
|
69 | 67 | bool isLabelsVisible() const; |
|
70 | 68 | |
|
71 | 69 | void setLabelsFormat(const QString &format); |
|
72 | 70 | QString labelsFormat() const; |
|
73 | 71 | |
|
74 | 72 | void setLabelsPosition(QAbstractBarSeries::LabelsPosition position); |
|
75 | 73 | QAbstractBarSeries::LabelsPosition labelsPosition() const; |
|
76 | 74 | |
|
77 | 75 | protected: |
|
78 | 76 | explicit QAbstractBarSeries(QAbstractBarSeriesPrivate &d, QObject *parent = 0); |
|
79 | 77 | |
|
80 | 78 | Q_SIGNALS: |
|
81 | 79 | void clicked(int index, QBarSet *barset); |
|
82 | 80 | void hovered(bool status, QBarSet *barset); |
|
83 | 81 | void hovered(bool status, int index, QBarSet *barset); |
|
84 | 82 | void countChanged(); |
|
85 | 83 | void labelsVisibleChanged(); |
|
86 | 84 | void labelsFormatChanged(const QString &format); |
|
87 | 85 | void labelsPositionChanged(QAbstractBarSeries::LabelsPosition position); |
|
88 | 86 | |
|
89 | 87 | void barsetsAdded(QList<QBarSet *> sets); |
|
90 | 88 | void barsetsRemoved(QList<QBarSet *> sets); |
|
91 | 89 | |
|
92 | 90 | protected: |
|
93 | 91 | Q_DECLARE_PRIVATE(QAbstractBarSeries) |
|
94 | 92 | friend class AbstractBarChartItem; |
|
95 | 93 | friend class PercentBarChartItem; |
|
96 | 94 | friend class StackedBarChartItem; |
|
97 | 95 | friend class BoxPlotChartItem; |
|
98 | 96 | friend class BarChartItem; |
|
99 | 97 | friend class HorizontalBarChartItem; |
|
100 | 98 | friend class HorizontalStackedBarChartItem; |
|
101 | 99 | friend class HorizontalPercentBarChartItem; |
|
102 | 100 | friend class BarSet; |
|
103 | 101 | }; |
|
104 | 102 | |
|
105 | 103 | QTCOMMERCIALCHART_END_NAMESPACE |
|
106 | 104 | |
|
107 | 105 | #endif // QABSTRACTBARSERIES_H |
@@ -1,124 +1,120 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2014 Digia Plc |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
8 | 8 | ** |
|
9 | 9 | ** $QT_BEGIN_LICENSE$ |
|
10 | 10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
11 | 11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
12 | 12 | ** Software or, alternatively, in accordance with the terms contained in |
|
13 | 13 | ** a written agreement between you and Digia. |
|
14 | 14 | ** |
|
15 | 15 | ** If you have questions regarding the use of this file, please use |
|
16 | 16 | ** contact form at http://qt.digia.com |
|
17 | 17 | ** $QT_END_LICENSE$ |
|
18 | 18 | ** |
|
19 | 19 | ****************************************************************************/ |
|
20 | 20 | |
|
21 | 21 | #ifndef QXYSERIES_H |
|
22 | 22 | #define QXYSERIES_H |
|
23 | 23 | |
|
24 | 24 | #include <qchartglobal.h> |
|
25 | 25 | #include <qabstractseries.h> |
|
26 | 26 | #include <QPen> |
|
27 | 27 | #include <QBrush> |
|
28 | 28 | |
|
29 | 29 | class QModelIndex; |
|
30 | 30 | |
|
31 | 31 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
32 | 32 | |
|
33 | 33 | class QXYSeriesPrivate; |
|
34 | 34 | class QXYModelMapper; |
|
35 | 35 | |
|
36 | 36 | class QTCOMMERCIALCHART_EXPORT QXYSeries : public QAbstractSeries |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | Q_PROPERTY(bool pointsVisible READ pointsVisible WRITE setPointsVisible) |
|
40 | 40 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) |
|
41 | Q_PROPERTY(QString pointLabelsFormat READ pointLabelsFormat WRITE setPointLabelsFormat | |
|
42 | NOTIFY pointLabelsFormatChanged) | |
|
43 |
Q_PROPERTY( |
|
|
44 | NOTIFY pointLabelsVisibilityChanged) | |
|
45 | Q_PROPERTY(QFont pointLabelsFont READ pointLabelsFont WRITE setPointLabelsFont | |
|
46 | NOTIFY pointLabelsFontChanged) | |
|
47 | Q_PROPERTY(QColor pointLabelsColor READ pointLabelsColor WRITE setPointLabelsColor | |
|
48 | NOTIFY pointLabelsColorChanged) | |
|
41 | Q_PROPERTY(QString pointLabelsFormat READ pointLabelsFormat WRITE setPointLabelsFormat NOTIFY pointLabelsFormatChanged) | |
|
42 | Q_PROPERTY(bool pointLabelsVisible READ pointLabelsVisible WRITE setPointLabelsVisible NOTIFY pointLabelsVisibilityChanged) | |
|
43 | Q_PROPERTY(QFont pointLabelsFont READ pointLabelsFont WRITE setPointLabelsFont NOTIFY pointLabelsFontChanged) | |
|
44 | Q_PROPERTY(QColor pointLabelsColor READ pointLabelsColor WRITE setPointLabelsColor NOTIFY pointLabelsColorChanged) | |
|
49 | 45 | |
|
50 | 46 | protected: |
|
51 | 47 | explicit QXYSeries(QXYSeriesPrivate &d, QObject *parent = 0); |
|
52 | 48 | |
|
53 | 49 | public: |
|
54 | 50 | ~QXYSeries(); |
|
55 | 51 | void append(qreal x, qreal y); |
|
56 | 52 | void append(const QPointF &point); |
|
57 | 53 | void append(const QList<QPointF> &points); |
|
58 | 54 | void replace(qreal oldX, qreal oldY, qreal newX, qreal newY); |
|
59 | 55 | void replace(const QPointF &oldPoint, const QPointF &newPoint); |
|
60 | 56 | void replace(int index, qreal newX, qreal newY); |
|
61 | 57 | void replace(int index, const QPointF &newPoint); |
|
62 | 58 | void remove(qreal x, qreal y); |
|
63 | 59 | void remove(const QPointF &point); |
|
64 | 60 | void remove(int index); |
|
65 | 61 | void insert(int index, const QPointF &point); |
|
66 | 62 | void clear(); |
|
67 | 63 | |
|
68 | 64 | int count() const; |
|
69 | 65 | QList<QPointF> points() const; |
|
70 | 66 | const QPointF &at(int index) const; |
|
71 | 67 | |
|
72 | 68 | QXYSeries &operator << (const QPointF &point); |
|
73 | 69 | QXYSeries &operator << (const QList<QPointF> &points); |
|
74 | 70 | |
|
75 | 71 | virtual void setPen(const QPen &pen); |
|
76 | 72 | QPen pen() const; |
|
77 | 73 | |
|
78 | 74 | virtual void setBrush(const QBrush &brush); |
|
79 | 75 | QBrush brush() const; |
|
80 | 76 | |
|
81 | 77 | virtual void setColor(const QColor &color); |
|
82 | 78 | virtual QColor color() const; |
|
83 | 79 | |
|
84 | 80 | void setPointsVisible(bool visible = true); |
|
85 | 81 | bool pointsVisible() const; |
|
86 | 82 | |
|
87 | 83 | void setPointLabelsFormat(const QString &format); |
|
88 | 84 | QString pointLabelsFormat() const; |
|
89 | 85 | |
|
90 | 86 | void setPointLabelsVisible(bool visible = true); |
|
91 | 87 | bool pointLabelsVisible() const; |
|
92 | 88 | |
|
93 | 89 | void setPointLabelsFont(const QFont &font); |
|
94 | 90 | QFont pointLabelsFont() const; |
|
95 | 91 | |
|
96 | 92 | void setPointLabelsColor(const QColor &color); |
|
97 | 93 | QColor pointLabelsColor() const; |
|
98 | 94 | |
|
99 | 95 | void replace(QList<QPointF> points); |
|
100 | 96 | |
|
101 | 97 | Q_SIGNALS: |
|
102 | 98 | void clicked(const QPointF &point); |
|
103 | 99 | void hovered(const QPointF &point, bool state); |
|
104 | 100 | void pointReplaced(int index); |
|
105 | 101 | void pointRemoved(int index); |
|
106 | 102 | void pointAdded(int index); |
|
107 | 103 | void colorChanged(QColor color); |
|
108 | 104 | void pointsReplaced(); |
|
109 | 105 | void pointLabelsFormatChanged(const QString &format); |
|
110 | 106 | void pointLabelsVisibilityChanged(bool visible); |
|
111 | 107 | void pointLabelsFontChanged(const QFont &font); |
|
112 | 108 | void pointLabelsColorChanged(const QColor &color); |
|
113 | 109 | |
|
114 | 110 | private: |
|
115 | 111 | Q_DECLARE_PRIVATE(QXYSeries) |
|
116 | 112 | Q_DISABLE_COPY(QXYSeries) |
|
117 | 113 | friend class QXYLegendMarkerPrivate; |
|
118 | 114 | friend class XYLegendMarker; |
|
119 | 115 | friend class XYChart; |
|
120 | 116 | }; |
|
121 | 117 | |
|
122 | 118 | QTCOMMERCIALCHART_END_NAMESPACE |
|
123 | 119 | |
|
124 | 120 | #endif // QXYSERIES_H |
General Comments 0
You need to be logged in to leave comments.
Login now