@@ -1,193 +1,195 | |||
|
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 QABSTRACTAXIS_H |
|
22 | 22 | #define QABSTRACTAXIS_H |
|
23 | 23 | |
|
24 | 24 | #include <QtCharts/QChartGlobal> |
|
25 | 25 | #include <QtGui/QPen> |
|
26 | 26 | #include <QtGui/QFont> |
|
27 | 27 | #include <QtCore/QVariant> |
|
28 | 28 | |
|
29 | 29 | QT_CHARTS_BEGIN_NAMESPACE |
|
30 | 30 | |
|
31 | 31 | class QAbstractAxisPrivate; |
|
32 | 32 | |
|
33 | 33 | class QT_CHARTS_EXPORT QAbstractAxis : public QObject |
|
34 | 34 | { |
|
35 | 35 | Q_OBJECT |
|
36 | 36 | //visibility |
|
37 | 37 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) |
|
38 | 38 | //arrow |
|
39 | 39 | Q_PROPERTY(bool lineVisible READ isLineVisible WRITE setLineVisible NOTIFY lineVisibleChanged) |
|
40 | 40 | Q_PROPERTY(QPen linePen READ linePen WRITE setLinePen NOTIFY linePenChanged) |
|
41 | 41 | Q_PROPERTY(QColor color READ linePenColor WRITE setLinePenColor NOTIFY colorChanged) |
|
42 | 42 | //labels |
|
43 | 43 | Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged) |
|
44 | 44 | Q_PROPERTY(QPen labelsPen READ labelsPen WRITE setLabelsPen NOTIFY labelsPenChanged) |
|
45 | 45 | Q_PROPERTY(QBrush labelsBrush READ labelsBrush WRITE setLabelsBrush NOTIFY labelsBrushChanged) |
|
46 | 46 | Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle NOTIFY labelsAngleChanged) |
|
47 | 47 | Q_PROPERTY(QFont labelsFont READ labelsFont WRITE setLabelsFont NOTIFY labelsFontChanged) |
|
48 | 48 | Q_PROPERTY(QColor labelsColor READ labelsColor WRITE setLabelsColor NOTIFY labelsColorChanged) |
|
49 | 49 | //grid |
|
50 | 50 | Q_PROPERTY(bool gridVisible READ isGridLineVisible WRITE setGridLineVisible NOTIFY gridVisibleChanged) |
|
51 | 51 | Q_PROPERTY(QPen gridLinePen READ gridLinePen WRITE setGridLinePen NOTIFY gridLinePenChanged) |
|
52 | 52 | //shades |
|
53 | 53 | Q_PROPERTY(bool shadesVisible READ shadesVisible WRITE setShadesVisible NOTIFY shadesVisibleChanged) |
|
54 | 54 | Q_PROPERTY(QColor shadesColor READ shadesColor WRITE setShadesColor NOTIFY shadesColorChanged) |
|
55 | 55 | Q_PROPERTY(QColor shadesBorderColor READ shadesBorderColor WRITE setShadesBorderColor NOTIFY shadesBorderColorChanged) |
|
56 | 56 | Q_PROPERTY(QPen shadesPen READ shadesPen WRITE setShadesPen NOTIFY shadesPenChanged) |
|
57 | 57 | Q_PROPERTY(QBrush shadesBrush READ shadesBrush WRITE setShadesBrush NOTIFY shadesBrushChanged) |
|
58 | 58 | //title |
|
59 | 59 | Q_PROPERTY(QString titleText READ titleText WRITE setTitleText NOTIFY titleTextChanged) |
|
60 | 60 | Q_PROPERTY(QPen titlePen READ titlePen WRITE setTitlePen NOTIFY titlePenChanged) |
|
61 | 61 | Q_PROPERTY(QBrush titleBrush READ titleBrush WRITE setTitleBrush NOTIFY titleBrushChanged) |
|
62 | 62 | Q_PROPERTY(bool titleVisible READ isTitleVisible WRITE setTitleVisible NOTIFY titleVisibleChanged) |
|
63 | 63 | Q_PROPERTY(QFont titleFont READ titleFont WRITE setTitleFont NOTIFY titleFontChanged) |
|
64 | 64 | //orientation |
|
65 | 65 | Q_PROPERTY(Qt::Orientation orientation READ orientation) |
|
66 | 66 | //aligment |
|
67 | 67 | Q_PROPERTY(Qt::Alignment alignment READ alignment) |
|
68 | 68 | |
|
69 | 69 | public: |
|
70 | 70 | |
|
71 | 71 | enum AxisType { |
|
72 | 72 | AxisTypeNoAxis = 0x0, |
|
73 | 73 | AxisTypeValue = 0x1, |
|
74 | 74 | AxisTypeBarCategory = 0x2, |
|
75 | 75 | AxisTypeCategory = 0x4, |
|
76 | 76 | AxisTypeDateTime = 0x8, |
|
77 | 77 | AxisTypeLogValue = 0x10 |
|
78 | 78 | }; |
|
79 | 79 | |
|
80 | 80 | Q_DECLARE_FLAGS(AxisTypes, AxisType) |
|
81 | 81 | |
|
82 | 82 | protected: |
|
83 | 83 | explicit QAbstractAxis(QAbstractAxisPrivate &d, QObject *parent = 0); |
|
84 | 84 | |
|
85 | 85 | public: |
|
86 | 86 | ~QAbstractAxis(); |
|
87 | 87 | |
|
88 | 88 | virtual AxisType type() const = 0; |
|
89 | 89 | |
|
90 | 90 | //visibility handling |
|
91 | 91 | bool isVisible() const; |
|
92 | 92 | void setVisible(bool visible = true); |
|
93 | 93 | void show(); |
|
94 | 94 | void hide(); |
|
95 | 95 | |
|
96 | 96 | //arrow handling |
|
97 | 97 | bool isLineVisible() const; |
|
98 | 98 | void setLineVisible(bool visible = true); |
|
99 | 99 | void setLinePen(const QPen &pen); |
|
100 | 100 | QPen linePen() const; |
|
101 | 101 | void setLinePenColor(QColor color); |
|
102 | 102 | QColor linePenColor() const; |
|
103 | 103 | |
|
104 | 104 | //grid handling |
|
105 | 105 | bool isGridLineVisible() const; |
|
106 | 106 | void setGridLineVisible(bool visible = true); |
|
107 | 107 | void setGridLinePen(const QPen &pen); |
|
108 | 108 | QPen gridLinePen() const; |
|
109 | 109 | |
|
110 | 110 | //labels handling |
|
111 | 111 | bool labelsVisible() const; |
|
112 | 112 | void setLabelsVisible(bool visible = true); |
|
113 | 113 | void setLabelsPen(const QPen &pen); |
|
114 | 114 | QPen labelsPen() const; |
|
115 | 115 | void setLabelsBrush(const QBrush &brush); |
|
116 | 116 | QBrush labelsBrush() const; |
|
117 | 117 | void setLabelsFont(const QFont &font); |
|
118 | 118 | QFont labelsFont() const; |
|
119 | 119 | void setLabelsAngle(int angle); |
|
120 | 120 | int labelsAngle() const; |
|
121 | 121 | void setLabelsColor(QColor color); |
|
122 | 122 | QColor labelsColor() const; |
|
123 | 123 | |
|
124 | 124 | //title handling |
|
125 | 125 | bool isTitleVisible() const; |
|
126 | 126 | void setTitleVisible(bool visible = true); |
|
127 | 127 | void setTitlePen(const QPen &pen); |
|
128 | 128 | QPen titlePen() const; |
|
129 | 129 | void setTitleBrush(const QBrush &brush); |
|
130 | 130 | QBrush titleBrush() const; |
|
131 | 131 | void setTitleFont(const QFont &font); |
|
132 | 132 | QFont titleFont() const; |
|
133 | 133 | void setTitleText(const QString &title); |
|
134 | 134 | QString titleText() const; |
|
135 | 135 | |
|
136 | 136 | //shades handling |
|
137 | 137 | bool shadesVisible() const; |
|
138 | 138 | void setShadesVisible(bool visible = true); |
|
139 | 139 | void setShadesPen(const QPen &pen); |
|
140 | 140 | QPen shadesPen() const; |
|
141 | 141 | void setShadesBrush(const QBrush &brush); |
|
142 | 142 | QBrush shadesBrush() const; |
|
143 | 143 | void setShadesColor(QColor color); |
|
144 | 144 | QColor shadesColor() const; |
|
145 | 145 | void setShadesBorderColor(QColor color); |
|
146 | 146 | QColor shadesBorderColor() const; |
|
147 | 147 | |
|
148 | 148 | Qt::Orientation orientation(); |
|
149 | 149 | Qt::Alignment alignment() const; |
|
150 | 150 | |
|
151 | 151 | //range handling |
|
152 | 152 | void setMin(const QVariant &min); |
|
153 | 153 | void setMax(const QVariant &max); |
|
154 | 154 | void setRange(const QVariant &min, const QVariant &max); |
|
155 | 155 | |
|
156 | 156 | Q_SIGNALS: |
|
157 | 157 | void visibleChanged(bool visible); |
|
158 | 158 | void linePenChanged(const QPen &pen); |
|
159 | 159 | void lineVisibleChanged(bool visible); |
|
160 | 160 | void labelsVisibleChanged(bool visible); |
|
161 | 161 | void labelsPenChanged(const QPen &pen); |
|
162 | 162 | void labelsBrushChanged(const QBrush &brush); |
|
163 | 163 | void labelsFontChanged(const QFont &pen); |
|
164 | 164 | void labelsAngleChanged(int angle); |
|
165 | 165 | void gridLinePenChanged(const QPen &pen); |
|
166 | 166 | void gridVisibleChanged(bool visible); |
|
167 | 167 | void colorChanged(QColor color); |
|
168 | 168 | void labelsColorChanged(QColor color); |
|
169 | 169 | void titleTextChanged(const QString &title); |
|
170 | 170 | void titlePenChanged(const QPen &pen); |
|
171 | 171 | void titleBrushChanged(const QBrush &brush); |
|
172 | 172 | void titleVisibleChanged(bool visible); |
|
173 | 173 | void titleFontChanged(const QFont &font); |
|
174 | 174 | void shadesVisibleChanged(bool visible); |
|
175 | 175 | void shadesColorChanged(QColor color); |
|
176 | 176 | void shadesBorderColorChanged(QColor color); |
|
177 | 177 | void shadesPenChanged(const QPen &pen); |
|
178 | 178 | void shadesBrushChanged(const QBrush &brush); |
|
179 | 179 | |
|
180 | 180 | protected: |
|
181 | 181 | QScopedPointer<QAbstractAxisPrivate> d_ptr; |
|
182 | Q_DISABLE_COPY(QAbstractAxis) | |
|
183 | 182 | friend class ChartDataSet; |
|
184 | 183 | friend class ChartPresenter; |
|
185 | 184 | friend class ChartThemeManager; |
|
186 | 185 | friend class AbstractDomain; |
|
187 | 186 | friend class ChartAxisElement; |
|
188 | 187 | friend class XYChart; |
|
188 | ||
|
189 | private: | |
|
190 | Q_DISABLE_COPY(QAbstractAxis) | |
|
189 | 191 | }; |
|
190 | 192 | |
|
191 | 193 | QT_CHARTS_END_NAMESPACE |
|
192 | 194 | |
|
193 | 195 | #endif // QABSTRACTAXIS_H |
@@ -1,105 +1,107 | |||
|
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 QLEGENDMARKER_H |
|
22 | 22 | #define QLEGENDMARKER_H |
|
23 | 23 | |
|
24 | 24 | #include <QtCharts/QChartGlobal> |
|
25 | 25 | #include <QtCore/QObject> |
|
26 | 26 | #include <QtGui/QPen> |
|
27 | 27 | #include <QtGui/QBrush> |
|
28 | 28 | #include <QtGui/QFont> |
|
29 | 29 | |
|
30 | 30 | QT_CHARTS_BEGIN_NAMESPACE |
|
31 | 31 | |
|
32 | 32 | class QLegendMarkerPrivate; |
|
33 | 33 | class QAbstractSeries; |
|
34 | 34 | class QLegend; |
|
35 | 35 | |
|
36 | 36 | class QT_CHARTS_EXPORT QLegendMarker : public QObject |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | |
|
40 | 40 | public: |
|
41 | 41 | enum LegendMarkerType { |
|
42 | 42 | LegendMarkerTypeArea, |
|
43 | 43 | LegendMarkerTypeBar, |
|
44 | 44 | LegendMarkerTypePie, |
|
45 | 45 | LegendMarkerTypeXY, |
|
46 | 46 | LegendMarkerTypeBoxPlot |
|
47 | 47 | }; |
|
48 | 48 | |
|
49 | 49 | Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged) |
|
50 | 50 | Q_PROPERTY(QBrush labelBrush READ labelBrush WRITE setLabelBrush NOTIFY labelBrushChanged) |
|
51 | 51 | Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged) |
|
52 | 52 | Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged) |
|
53 | 53 | Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged) |
|
54 | 54 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) |
|
55 | 55 | Q_ENUMS(LegendMarkerType) |
|
56 | 56 | |
|
57 | 57 | public: |
|
58 | 58 | virtual ~QLegendMarker(); |
|
59 | 59 | virtual LegendMarkerType type() = 0; |
|
60 | 60 | |
|
61 | 61 | QString label() const; |
|
62 | 62 | void setLabel(const QString &label); |
|
63 | 63 | |
|
64 | 64 | QBrush labelBrush() const; |
|
65 | 65 | void setLabelBrush(const QBrush &brush); |
|
66 | 66 | |
|
67 | 67 | QFont font() const; |
|
68 | 68 | void setFont(const QFont &font); |
|
69 | 69 | |
|
70 | 70 | QPen pen() const; |
|
71 | 71 | void setPen(const QPen &pen); |
|
72 | 72 | |
|
73 | 73 | QBrush brush() const; |
|
74 | 74 | void setBrush(const QBrush &brush); |
|
75 | 75 | |
|
76 | 76 | bool isVisible() const; |
|
77 | 77 | void setVisible(bool visible); |
|
78 | 78 | |
|
79 | 79 | virtual QAbstractSeries* series() = 0; |
|
80 | 80 | |
|
81 | 81 | Q_SIGNALS: |
|
82 | 82 | void clicked(); |
|
83 | 83 | void hovered(bool status); |
|
84 | 84 | void labelChanged(); |
|
85 | 85 | void labelBrushChanged(); |
|
86 | 86 | void fontChanged(); |
|
87 | 87 | void penChanged(); |
|
88 | 88 | void brushChanged(); |
|
89 | 89 | void visibleChanged(); |
|
90 | 90 | |
|
91 | 91 | protected: |
|
92 | 92 | explicit QLegendMarker(QLegendMarkerPrivate &d, QObject *parent = 0); |
|
93 | 93 | |
|
94 | 94 | QScopedPointer<QLegendMarkerPrivate> d_ptr; |
|
95 | Q_DISABLE_COPY(QLegendMarker) | |
|
96 | 95 | friend class QLegendPrivate; |
|
97 | 96 | friend class QLegendMarkerPrivate; |
|
98 | 97 | friend class LegendMarkerItem; |
|
99 | 98 | friend class LegendLayout; |
|
100 | 99 | friend class LegendScroller; |
|
100 | ||
|
101 | private: | |
|
102 | Q_DISABLE_COPY(QLegendMarker) | |
|
101 | 103 | }; |
|
102 | 104 | |
|
103 | 105 | QT_CHARTS_END_NAMESPACE |
|
104 | 106 | |
|
105 | 107 | #endif // QLEGENDMARKER_H |
@@ -1,187 +1,189 | |||
|
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 QCHART_H |
|
22 | 22 | #define QCHART_H |
|
23 | 23 | |
|
24 | 24 | #include <QtCharts/QAbstractSeries> |
|
25 | 25 | #include <QtCharts/QLegend> |
|
26 | 26 | #include <QtWidgets/QGraphicsWidget> |
|
27 | 27 | #include <QtCore/QMargins> |
|
28 | 28 | |
|
29 | 29 | class QGraphicsSceneResizeEvent; |
|
30 | 30 | |
|
31 | 31 | QT_CHARTS_BEGIN_NAMESPACE |
|
32 | 32 | |
|
33 | 33 | class QAbstractSeries; |
|
34 | 34 | class QAbstractAxis; |
|
35 | 35 | class QLegend; |
|
36 | 36 | class QChartPrivate; |
|
37 | 37 | class QBoxPlotSeries; |
|
38 | 38 | |
|
39 | 39 | class QT_CHARTS_EXPORT QChart : public QGraphicsWidget |
|
40 | 40 | { |
|
41 | 41 | Q_OBJECT |
|
42 | 42 | Q_PROPERTY(QChart::ChartTheme theme READ theme WRITE setTheme) |
|
43 | 43 | Q_PROPERTY(QString title READ title WRITE setTitle) |
|
44 | 44 | Q_PROPERTY(bool backgroundVisible READ isBackgroundVisible WRITE setBackgroundVisible) |
|
45 | 45 | Q_PROPERTY(bool dropShadowEnabled READ isDropShadowEnabled WRITE setDropShadowEnabled) |
|
46 | 46 | Q_PROPERTY(qreal backgroundRoundness READ backgroundRoundness WRITE setBackgroundRoundness) |
|
47 | 47 | Q_PROPERTY(QChart::AnimationOptions animationOptions READ animationOptions WRITE setAnimationOptions) |
|
48 | 48 | Q_PROPERTY(QMargins minimumMargins READ minimumMargins WRITE setMinimumMargins) |
|
49 | 49 | Q_PROPERTY(QMargins margins READ margins WRITE setMargins) |
|
50 | 50 | Q_PROPERTY(QChart::ChartType chartType READ chartType) |
|
51 | 51 | Q_PROPERTY(bool plotAreaBackgroundVisible READ isPlotAreaBackgroundVisible WRITE setPlotAreaBackgroundVisible) |
|
52 | 52 | Q_PROPERTY(bool localizeNumbers READ localizeNumbers WRITE setLocalizeNumbers) |
|
53 | 53 | Q_PROPERTY(QLocale locale READ locale WRITE setLocale) |
|
54 | 54 | Q_PROPERTY(QRectF plotArea READ plotArea NOTIFY plotAreaChanged) |
|
55 | 55 | Q_ENUMS(ChartTheme) |
|
56 | 56 | Q_ENUMS(AnimationOption) |
|
57 | 57 | Q_ENUMS(ChartType) |
|
58 | 58 | |
|
59 | 59 | public: |
|
60 | 60 | enum ChartType { |
|
61 | 61 | ChartTypeUndefined = 0, |
|
62 | 62 | ChartTypeCartesian, |
|
63 | 63 | ChartTypePolar |
|
64 | 64 | }; |
|
65 | 65 | |
|
66 | 66 | enum ChartTheme { |
|
67 | 67 | ChartThemeLight = 0, |
|
68 | 68 | ChartThemeBlueCerulean, |
|
69 | 69 | ChartThemeDark, |
|
70 | 70 | ChartThemeBrownSand, |
|
71 | 71 | ChartThemeBlueNcs, |
|
72 | 72 | ChartThemeHighContrast, |
|
73 | 73 | ChartThemeBlueIcy, |
|
74 | 74 | ChartThemeQt |
|
75 | 75 | }; |
|
76 | 76 | |
|
77 | 77 | enum AnimationOption { |
|
78 | 78 | NoAnimation = 0x0, |
|
79 | 79 | GridAxisAnimations = 0x1, |
|
80 | 80 | SeriesAnimations = 0x2, |
|
81 | 81 | AllAnimations = 0x3 |
|
82 | 82 | }; |
|
83 | 83 | |
|
84 | 84 | Q_DECLARE_FLAGS(AnimationOptions, AnimationOption) |
|
85 | 85 | |
|
86 | 86 | public: |
|
87 | 87 | explicit QChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0); |
|
88 | 88 | ~QChart(); |
|
89 | 89 | |
|
90 | 90 | void addSeries(QAbstractSeries *series); |
|
91 | 91 | void removeSeries(QAbstractSeries *series); |
|
92 | 92 | void removeAllSeries(); |
|
93 | 93 | QList<QAbstractSeries *> series() const; |
|
94 | 94 | |
|
95 | 95 | // *** deprecated *** |
|
96 | 96 | void setAxisX(QAbstractAxis *axis, QAbstractSeries *series = 0); |
|
97 | 97 | void setAxisY(QAbstractAxis *axis, QAbstractSeries *series = 0); |
|
98 | 98 | QAbstractAxis *axisX(QAbstractSeries *series = 0) const; |
|
99 | 99 | QAbstractAxis *axisY(QAbstractSeries *series = 0) const; |
|
100 | 100 | // ****************** |
|
101 | 101 | |
|
102 | 102 | void addAxis(QAbstractAxis *axis, Qt::Alignment alignment); |
|
103 | 103 | void removeAxis(QAbstractAxis *axis); |
|
104 | 104 | QList<QAbstractAxis*> axes(Qt::Orientations orientation = Qt::Horizontal|Qt::Vertical, QAbstractSeries *series = 0) const; |
|
105 | 105 | |
|
106 | 106 | void createDefaultAxes(); |
|
107 | 107 | |
|
108 | 108 | void setTheme(QChart::ChartTheme theme); |
|
109 | 109 | QChart::ChartTheme theme() const; |
|
110 | 110 | |
|
111 | 111 | void setTitle(const QString &title); |
|
112 | 112 | QString title() const; |
|
113 | 113 | void setTitleFont(const QFont &font); |
|
114 | 114 | QFont titleFont() const; |
|
115 | 115 | void setTitleBrush(const QBrush &brush); |
|
116 | 116 | QBrush titleBrush() const; |
|
117 | 117 | |
|
118 | 118 | void setBackgroundBrush(const QBrush &brush); |
|
119 | 119 | QBrush backgroundBrush() const; |
|
120 | 120 | void setBackgroundPen(const QPen &pen); |
|
121 | 121 | QPen backgroundPen() const; |
|
122 | 122 | void setBackgroundVisible(bool visible = true); |
|
123 | 123 | bool isBackgroundVisible() const; |
|
124 | 124 | |
|
125 | 125 | void setDropShadowEnabled(bool enabled = true); |
|
126 | 126 | bool isDropShadowEnabled() const; |
|
127 | 127 | void setBackgroundRoundness(qreal diameter); |
|
128 | 128 | qreal backgroundRoundness() const; |
|
129 | 129 | void setAnimationOptions(AnimationOptions options); |
|
130 | 130 | AnimationOptions animationOptions() const; |
|
131 | 131 | |
|
132 | 132 | void zoomIn(); |
|
133 | 133 | void zoomOut(); |
|
134 | 134 | |
|
135 | 135 | void zoomIn(const QRectF &rect); |
|
136 | 136 | void zoom(qreal factor); |
|
137 | 137 | void zoomReset(); |
|
138 | 138 | bool isZoomed(); |
|
139 | 139 | |
|
140 | 140 | void scroll(qreal dx, qreal dy); |
|
141 | 141 | |
|
142 | 142 | QLegend *legend() const; |
|
143 | 143 | |
|
144 | 144 | void setMinimumMargins(const QMargins& margins); |
|
145 | 145 | QMargins minimumMargins() const; |
|
146 | 146 | |
|
147 | 147 | void setMargins(const QMargins &margins); |
|
148 | 148 | QMargins margins() const; |
|
149 | 149 | |
|
150 | 150 | QRectF plotArea() const; |
|
151 | 151 | void setPlotAreaBackgroundBrush(const QBrush &brush); |
|
152 | 152 | QBrush plotAreaBackgroundBrush() const; |
|
153 | 153 | void setPlotAreaBackgroundPen(const QPen &pen); |
|
154 | 154 | QPen plotAreaBackgroundPen() const; |
|
155 | 155 | void setPlotAreaBackgroundVisible(bool visible = true); |
|
156 | 156 | bool isPlotAreaBackgroundVisible() const; |
|
157 | 157 | void setLocalizeNumbers(bool localize); |
|
158 | 158 | bool localizeNumbers() const; |
|
159 | 159 | void setLocale(const QLocale &locale); |
|
160 | 160 | QLocale locale() const; |
|
161 | 161 | |
|
162 | 162 | QPointF mapToValue(const QPointF &position, QAbstractSeries *series = 0); |
|
163 | 163 | QPointF mapToPosition(const QPointF &value, QAbstractSeries *series = 0); |
|
164 | 164 | |
|
165 | 165 | ChartType chartType() const; |
|
166 | 166 | |
|
167 | 167 | signals: |
|
168 | 168 | void plotAreaChanged(const QRectF &plotArea); |
|
169 | 169 | |
|
170 | 170 | protected: |
|
171 | 171 | explicit QChart(QChart::ChartType type, QGraphicsItem *parent, Qt::WindowFlags wFlags); |
|
172 | 172 | QScopedPointer<QChartPrivate> d_ptr; |
|
173 | 173 | friend class QLegend; |
|
174 | 174 | friend class DeclarativeChart; |
|
175 | 175 | friend class ChartDataSet; |
|
176 | 176 | friend class ChartPresenter; |
|
177 | 177 | friend class ChartThemeManager; |
|
178 | 178 | friend class QAbstractSeries; |
|
179 | 179 | friend class QBoxPlotSeriesPrivate; |
|
180 | ||
|
181 | private: | |
|
180 | 182 | Q_DISABLE_COPY(QChart) |
|
181 | 183 | }; |
|
182 | 184 | |
|
183 | 185 | QT_CHARTS_END_NAMESPACE |
|
184 | 186 | |
|
185 | 187 | Q_DECLARE_OPERATORS_FOR_FLAGS(QT_CHARTS_NAMESPACE::QChart::AnimationOptions) |
|
186 | 188 | |
|
187 | 189 | #endif // QCHART_H |
@@ -1,74 +1,75 | |||
|
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 QCHARTVIEW_H |
|
22 | 22 | #define QCHARTVIEW_H |
|
23 | 23 | |
|
24 | 24 | #include <QtCharts/QAbstractAxis> |
|
25 | 25 | #include <QtCharts/QAbstractSeries> |
|
26 | 26 | #include <QtCharts/QChart> |
|
27 | 27 | #include <QtWidgets/QGraphicsView> |
|
28 | 28 | |
|
29 | 29 | class QGraphicsScene; |
|
30 | 30 | class QRubberBand; |
|
31 | 31 | |
|
32 | 32 | QT_CHARTS_BEGIN_NAMESPACE |
|
33 | 33 | |
|
34 | 34 | class QChartViewPrivate; |
|
35 | 35 | |
|
36 | 36 | class QT_CHARTS_EXPORT QChartView : public QGraphicsView |
|
37 | 37 | { |
|
38 | 38 | Q_OBJECT |
|
39 | 39 | Q_ENUMS(RubberBand) |
|
40 | 40 | public: |
|
41 | 41 | |
|
42 | 42 | enum RubberBand { |
|
43 | 43 | NoRubberBand = 0x0, |
|
44 | 44 | VerticalRubberBand = 0x1, |
|
45 | 45 | HorizonalRubberBand = 0x2, |
|
46 | 46 | RectangleRubberBand = 0x3 |
|
47 | 47 | }; |
|
48 | 48 | |
|
49 | 49 | Q_DECLARE_FLAGS(RubberBands, RubberBand) |
|
50 | 50 | |
|
51 | 51 | explicit QChartView(QWidget *parent = 0); |
|
52 | 52 | explicit QChartView(QChart *chart, QWidget *parent = 0); |
|
53 | 53 | ~QChartView(); |
|
54 | 54 | |
|
55 | 55 | void setRubberBand(const RubberBands &rubberBands); |
|
56 | 56 | RubberBands rubberBand() const; |
|
57 | 57 | |
|
58 | 58 | QChart *chart() const; |
|
59 | 59 | void setChart(QChart *chart); |
|
60 | 60 | |
|
61 | 61 | protected: |
|
62 | 62 | void resizeEvent(QResizeEvent *event); |
|
63 | 63 | void mousePressEvent(QMouseEvent *event); |
|
64 | 64 | void mouseMoveEvent(QMouseEvent *event); |
|
65 | 65 | void mouseReleaseEvent(QMouseEvent *event); |
|
66 | 66 | |
|
67 | protected: | |
|
68 | 67 | QScopedPointer<QChartViewPrivate> d_ptr; |
|
68 | ||
|
69 | private: | |
|
69 | 70 | Q_DISABLE_COPY(QChartView) |
|
70 | 71 | }; |
|
71 | 72 | |
|
72 | 73 | QT_CHARTS_END_NAMESPACE |
|
73 | 74 | |
|
74 | 75 | #endif // QCHARTVIEW_H |
@@ -1,60 +1,60 | |||
|
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 QPOLARCHART_H |
|
22 | 22 | #define QPOLARCHART_H |
|
23 | 23 | |
|
24 | 24 | #include <QtCharts/QChart> |
|
25 | 25 | |
|
26 | 26 | QT_CHARTS_BEGIN_NAMESPACE |
|
27 | 27 | |
|
28 | 28 | class QAbstractSeries; |
|
29 | 29 | class QAbstractAxis; |
|
30 | 30 | |
|
31 | 31 | class QT_CHARTS_EXPORT QPolarChart : public QChart |
|
32 | 32 | { |
|
33 | 33 | Q_OBJECT |
|
34 | 34 | Q_ENUMS(PolarOrientation) |
|
35 | 35 | Q_FLAGS(PolarOrientations) |
|
36 | 36 | |
|
37 | 37 | public: |
|
38 | 38 | enum PolarOrientation { |
|
39 | 39 | PolarOrientationRadial = 0x1, |
|
40 | 40 | PolarOrientationAngular = 0x2 |
|
41 | 41 | }; |
|
42 | 42 | Q_DECLARE_FLAGS(PolarOrientations, PolarOrientation) |
|
43 | 43 | |
|
44 | 44 | public: |
|
45 | 45 | explicit QPolarChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0); |
|
46 | 46 | ~QPolarChart(); |
|
47 | 47 | |
|
48 | 48 | void addAxis(QAbstractAxis *axis, PolarOrientation polarOrientation); |
|
49 | 49 | |
|
50 | 50 | QList<QAbstractAxis*> axes(PolarOrientations polarOrientation = PolarOrientations(PolarOrientationRadial | PolarOrientationAngular), QAbstractSeries *series = 0) const; |
|
51 | 51 | |
|
52 | 52 | static PolarOrientation axisPolarOrientation(QAbstractAxis *axis); |
|
53 | 53 | |
|
54 | protected: | |
|
54 | private: | |
|
55 | 55 | Q_DISABLE_COPY(QPolarChart) |
|
56 | 56 | }; |
|
57 | 57 | |
|
58 | 58 | QT_CHARTS_END_NAMESPACE |
|
59 | 59 | |
|
60 | 60 | #endif // QCHART_H |
General Comments 0
You need to be logged in to leave comments.
Login now