@@ -1,84 +1,84 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef QAREASERIES_H |
|
21 | #ifndef QAREASERIES_H | |
22 | #define QAREASERIES_H |
|
22 | #define QAREASERIES_H | |
23 |
|
23 | |||
24 | #include <qchartglobal.h> |
|
24 | #include <qchartglobal.h> | |
25 | #include <qabstractseries.h> |
|
25 | #include <qabstractseries.h> | |
26 | #include <QPen> |
|
26 | #include <QPen> | |
27 | #include <QBrush> |
|
27 | #include <QBrush> | |
28 |
|
28 | |||
29 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
29 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
30 | class QLineSeries; |
|
30 | class QLineSeries; | |
31 | class QAreaSeriesPrivate; |
|
31 | class QAreaSeriesPrivate; | |
32 |
|
32 | |||
33 | class QTCOMMERCIALCHART_EXPORT QAreaSeries : public QAbstractSeries |
|
33 | class QTCOMMERCIALCHART_EXPORT QAreaSeries : public QAbstractSeries | |
34 | { |
|
34 | { | |
35 | Q_OBJECT |
|
35 | Q_OBJECT | |
36 | Q_PROPERTY(QLineSeries *upperSeries READ upperSeries) |
|
36 | Q_PROPERTY(QLineSeries *upperSeries READ upperSeries) | |
37 | Q_PROPERTY(QLineSeries *lowerSeries READ lowerSeries) |
|
37 | Q_PROPERTY(QLineSeries *lowerSeries READ lowerSeries) | |
38 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) |
|
38 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) | |
39 | Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged) |
|
39 | Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged) | |
40 |
|
40 | |||
41 | public: |
|
41 | public: | |
42 | explicit QAreaSeries(QObject *parent = 0); |
|
42 | explicit QAreaSeries(QObject *parent = 0); | |
43 | explicit QAreaSeries(QLineSeries *upperSeries, QLineSeries *lowerSeries = 0); |
|
43 | explicit QAreaSeries(QLineSeries *upperSeries, QLineSeries *lowerSeries = 0); | |
44 | ~QAreaSeries(); |
|
44 | ~QAreaSeries(); | |
45 |
|
45 | |||
46 | public: |
|
46 | public: | |
47 | QAbstractSeries::SeriesType type() const; |
|
47 | QAbstractSeries::SeriesType type() const; | |
48 |
|
48 | |||
49 | void setUpperSeries(QLineSeries* series); |
|
49 | void setUpperSeries(QLineSeries* series); | |
50 | QLineSeries* upperSeries() const; |
|
50 | QLineSeries* upperSeries() const; | |
51 | void setLowerSeries(QLineSeries* series); |
|
51 | void setLowerSeries(QLineSeries* series); | |
52 | QLineSeries* lowerSeries() const; |
|
52 | QLineSeries* lowerSeries() const; | |
53 |
|
53 | |||
54 | void setPen(const QPen &pen); |
|
54 | void setPen(const QPen &pen); | |
55 | QPen pen() const; |
|
55 | QPen pen() const; | |
56 |
|
56 | |||
57 | void setBrush(const QBrush &brush); |
|
57 | void setBrush(const QBrush &brush); | |
58 | QBrush brush() const; |
|
58 | QBrush brush() const; | |
59 |
|
59 | |||
60 | void setColor(const QColor &color); |
|
60 | void setColor(const QColor &color); | |
61 | QColor color() const; |
|
61 | QColor color() const; | |
62 |
|
62 | |||
63 | void setBorderColor(const QColor &color); |
|
63 | void setBorderColor(const QColor &color); | |
64 | QColor borderColor() const; |
|
64 | QColor borderColor() const; | |
65 |
|
65 | |||
66 | void setPointsVisible(bool visible = true); |
|
66 | void setPointsVisible(bool visible = true); | |
67 | bool pointsVisible() const; |
|
67 | bool pointsVisible() const; | |
68 |
|
68 | |||
69 | Q_SIGNALS: |
|
69 | Q_SIGNALS: | |
70 | void clicked(const QPointF &point); |
|
70 | void clicked(const QPointF &point); | |
71 | void selected(); |
|
71 | void selected(); | |
72 | void colorChanged(QColor color); |
|
72 | void colorChanged(QColor color); | |
73 | void borderColorChanged(QColor color); |
|
73 | void borderColorChanged(QColor color); | |
74 |
|
74 | |||
75 | private: |
|
75 | private: | |
76 | Q_DECLARE_PRIVATE(QAreaSeries) |
|
76 | Q_DECLARE_PRIVATE(QAreaSeries) | |
77 | Q_DISABLE_COPY(QAreaSeries) |
|
77 | Q_DISABLE_COPY(QAreaSeries) | |
78 | friend class AreaLegendMarker; |
|
78 | friend class AreaLegendMarker; | |
79 | friend class AreaChartItem; |
|
79 | friend class AreaChartItem; | |
80 | }; |
|
80 | }; | |
81 |
|
81 | |||
82 | QTCOMMERCIALCHART_END_NAMESPACE |
|
82 | QTCOMMERCIALCHART_END_NAMESPACE | |
83 |
|
83 | |||
84 | #endif |
|
84 | #endif // QAREASERIES_H |
@@ -1,156 +1,157 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef QABSTRACTAXIS_H |
|
21 | #ifndef QABSTRACTAXIS_H | |
22 | #define QABSTRACTAXIS_H |
|
22 | #define QABSTRACTAXIS_H | |
23 |
|
23 | |||
24 | #include <qchartglobal.h> |
|
24 | #include <qchartglobal.h> | |
25 | #include <QPen> |
|
25 | #include <QPen> | |
26 | #include <QFont> |
|
26 | #include <QFont> | |
27 | #include <QVariant> |
|
27 | #include <QVariant> | |
28 |
|
28 | |||
29 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
29 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
30 |
|
30 | |||
31 | class QAbstractAxisPrivate; |
|
31 | class QAbstractAxisPrivate; | |
32 |
|
32 | |||
33 | class QTCOMMERCIALCHART_EXPORT QAbstractAxis : public QObject |
|
33 | class QTCOMMERCIALCHART_EXPORT QAbstractAxis : public QObject | |
34 | { |
|
34 | { | |
35 | Q_OBJECT |
|
35 | Q_OBJECT | |
36 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) |
|
36 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) | |
37 | Q_PROPERTY(bool lineVisible READ isLineVisible WRITE setLineVisible NOTIFY lineVisibleChanged) |
|
37 | Q_PROPERTY(bool lineVisible READ isLineVisible WRITE setLineVisible NOTIFY lineVisibleChanged) | |
38 | Q_PROPERTY(QColor color READ linePenColor WRITE setLinePenColor NOTIFY colorChanged) |
|
38 | Q_PROPERTY(QColor color READ linePenColor WRITE setLinePenColor NOTIFY colorChanged) | |
39 | Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged) |
|
39 | Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged) | |
40 | Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle) |
|
40 | Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle) | |
41 | Q_PROPERTY(QFont labelsFont READ labelsFont WRITE setLabelsFont) |
|
41 | Q_PROPERTY(QFont labelsFont READ labelsFont WRITE setLabelsFont) | |
42 | Q_PROPERTY(QColor labelsColor READ labelsColor WRITE setLabelsColor NOTIFY labelsColorChanged) |
|
42 | Q_PROPERTY(QColor labelsColor READ labelsColor WRITE setLabelsColor NOTIFY labelsColorChanged) | |
43 | Q_PROPERTY(bool gridVisible READ isGridLineVisible WRITE setGridLineVisible NOTIFY gridVisibleChanged) |
|
43 | Q_PROPERTY(bool gridVisible READ isGridLineVisible WRITE setGridLineVisible NOTIFY gridVisibleChanged) | |
44 | Q_PROPERTY(bool shadesVisible READ shadesVisible WRITE setShadesVisible NOTIFY shadesVisibleChanged) |
|
44 | Q_PROPERTY(bool shadesVisible READ shadesVisible WRITE setShadesVisible NOTIFY shadesVisibleChanged) | |
45 | Q_PROPERTY(QColor shadesColor READ shadesColor WRITE setShadesColor NOTIFY shadesColorChanged) |
|
45 | Q_PROPERTY(QColor shadesColor READ shadesColor WRITE setShadesColor NOTIFY shadesColorChanged) | |
46 | Q_PROPERTY(QColor shadesBorderColor READ shadesBorderColor WRITE setShadesBorderColor NOTIFY shadesBorderColorChanged) |
|
46 | Q_PROPERTY(QColor shadesBorderColor READ shadesBorderColor WRITE setShadesBorderColor NOTIFY shadesBorderColorChanged) | |
47 |
|
47 | |||
48 | public: |
|
48 | public: | |
49 |
|
49 | |||
50 | enum AxisType { |
|
50 | enum AxisType { | |
51 | AxisTypeNoAxis = 0x0, |
|
51 | AxisTypeNoAxis = 0x0, | |
52 | AxisTypeValue = 0x1, |
|
52 | AxisTypeValue = 0x1, | |
53 | AxisTypeBarCategory = 0x2, |
|
53 | AxisTypeBarCategory = 0x2, | |
54 | AxisTypeCategory = 0x3, |
|
54 | AxisTypeCategory = 0x3, | |
55 | AxisTypeDateTime = 0x4 |
|
55 | AxisTypeDateTime = 0x4 | |
56 | }; |
|
56 | }; | |
57 |
|
57 | |||
58 | Q_DECLARE_FLAGS(AxisTypes, AxisType) |
|
58 | Q_DECLARE_FLAGS(AxisTypes, AxisType) | |
59 |
|
59 | |||
60 | protected: |
|
60 | protected: | |
61 | explicit QAbstractAxis(QAbstractAxisPrivate &d,QObject *parent = 0); |
|
61 | explicit QAbstractAxis(QAbstractAxisPrivate &d,QObject *parent = 0); | |
62 |
|
62 | |||
63 | public: |
|
63 | public: | |
64 | ~QAbstractAxis(); |
|
64 | ~QAbstractAxis(); | |
65 |
|
65 | |||
66 | virtual AxisType type() const = 0; |
|
66 | virtual AxisType type() const = 0; | |
67 |
|
67 | |||
68 |
//visibilty ha |
|
68 | //visibilty handling | |
69 | bool isVisible() const; |
|
69 | bool isVisible() const; | |
70 | void setVisible(bool visible = true); |
|
70 | void setVisible(bool visible = true); | |
71 |
|
71 | |||
72 |
|
72 | |||
73 | //axis handling |
|
73 | //axis handling | |
74 | bool isLineVisible() const; |
|
74 | bool isLineVisible() const; | |
75 | void setLineVisible(bool visible = true); |
|
75 | void setLineVisible(bool visible = true); | |
76 | void setLinePen(const QPen &pen); |
|
76 | void setLinePen(const QPen &pen); | |
77 | QPen linePen() const; |
|
77 | QPen linePen() const; | |
78 | void setLinePenColor(QColor color); |
|
78 | void setLinePenColor(QColor color); | |
79 | QColor linePenColor() const; |
|
79 | QColor linePenColor() const; | |
80 |
|
80 | |||
81 | //grid handling |
|
81 | //grid handling | |
82 | bool isGridLineVisible() const; |
|
82 | bool isGridLineVisible() const; | |
83 | void setGridLineVisible(bool visible = true); |
|
83 | void setGridLineVisible(bool visible = true); | |
84 | void setGridLinePen(const QPen &pen); |
|
84 | void setGridLinePen(const QPen &pen); | |
85 | QPen gridLinePen() const; |
|
85 | QPen gridLinePen() const; | |
86 |
|
86 | |||
87 | //labels handling |
|
87 | //labels handling | |
88 | bool labelsVisible() const; |
|
88 | bool labelsVisible() const; | |
89 | void setLabelsVisible(bool visible = true); |
|
89 | void setLabelsVisible(bool visible = true); | |
90 | void setLabelsPen(const QPen &pen); |
|
90 | void setLabelsPen(const QPen &pen); | |
91 | QPen labelsPen() const; |
|
91 | QPen labelsPen() const; | |
92 | void setLabelsBrush(const QBrush &brush); |
|
92 | void setLabelsBrush(const QBrush &brush); | |
93 | QBrush labelsBrush() const; |
|
93 | QBrush labelsBrush() const; | |
94 | void setLabelsFont(const QFont &font); |
|
94 | void setLabelsFont(const QFont &font); | |
95 | QFont labelsFont() const; |
|
95 | QFont labelsFont() const; | |
96 | void setLabelsAngle(int angle); |
|
96 | void setLabelsAngle(int angle); | |
97 | int labelsAngle() const; |
|
97 | int labelsAngle() const; | |
98 | void setLabelsColor(QColor color); |
|
98 | void setLabelsColor(QColor color); | |
99 | QColor labelsColor() const; |
|
99 | QColor labelsColor() const; | |
100 |
|
100 | |||
101 | //title handling |
|
101 | //title handling | |
102 | bool titleVisible() const; |
|
102 | bool titleVisible() const; | |
103 | void setTitleVisible(bool visible = true); |
|
103 | void setTitleVisible(bool visible = true); | |
104 | void setTitlePen(const QPen &pen); |
|
104 | void setTitlePen(const QPen &pen); | |
105 | QPen titlePen() const; |
|
105 | QPen titlePen() const; | |
106 | void setTitleBrush(const QBrush &brush); |
|
106 | void setTitleBrush(const QBrush &brush); | |
107 | QBrush titleBrush() const; |
|
107 | QBrush titleBrush() const; | |
108 | void setTitleFont(const QFont &font); |
|
108 | void setTitleFont(const QFont &font); | |
109 | QFont titleFont() const; |
|
109 | QFont titleFont() const; | |
110 | void setTitle(const QString& title); |
|
110 | void setTitle(const QString& title); | |
111 | QString title() const; |
|
111 | QString title() const; | |
112 |
|
112 | |||
113 |
|
113 | |||
114 | //shades handling |
|
114 | //shades handling | |
115 | bool shadesVisible() const; |
|
115 | bool shadesVisible() const; | |
116 | void setShadesVisible(bool visible = true); |
|
116 | void setShadesVisible(bool visible = true); | |
117 | void setShadesPen(const QPen &pen); |
|
117 | void setShadesPen(const QPen &pen); | |
118 | QPen shadesPen() const; |
|
118 | QPen shadesPen() const; | |
119 | void setShadesBrush(const QBrush &brush); |
|
119 | void setShadesBrush(const QBrush &brush); | |
120 | QBrush shadesBrush() const; |
|
120 | QBrush shadesBrush() const; | |
121 | void setShadesColor(QColor color); |
|
121 | void setShadesColor(QColor color); | |
122 | QColor shadesColor() const; |
|
122 | QColor shadesColor() const; | |
123 | void setShadesBorderColor(QColor color); |
|
123 | void setShadesBorderColor(QColor color); | |
124 | QColor shadesBorderColor() const; |
|
124 | QColor shadesBorderColor() const; | |
125 |
|
125 | |||
126 | Qt::Orientation orientation(); |
|
126 | Qt::Orientation orientation(); | |
127 |
|
127 | |||
128 | //range handling |
|
128 | //range handling | |
129 | void setMin(const QVariant &min); |
|
129 | void setMin(const QVariant &min); | |
130 | void setMax(const QVariant &max); |
|
130 | void setMax(const QVariant &max); | |
131 | void setRange(const QVariant &min, const QVariant &max); |
|
131 | void setRange(const QVariant &min, const QVariant &max); | |
132 |
|
132 | |||
133 | void show(); |
|
133 | void show(); | |
134 | void hide(); |
|
134 | void hide(); | |
135 |
|
135 | |||
136 | Q_SIGNALS: |
|
136 | Q_SIGNALS: | |
137 | void visibleChanged(bool visible); |
|
137 | void visibleChanged(bool visible); | |
138 | void lineVisibleChanged(bool visible); |
|
138 | void lineVisibleChanged(bool visible); | |
139 | void labelsVisibleChanged(bool visible); |
|
139 | void labelsVisibleChanged(bool visible); | |
140 | void gridVisibleChanged(bool visible); |
|
140 | void gridVisibleChanged(bool visible); | |
141 | void colorChanged(QColor color); |
|
141 | void colorChanged(QColor color); | |
142 | void labelsColorChanged(QColor color); |
|
142 | void labelsColorChanged(QColor color); | |
143 | void shadesVisibleChanged(bool visible); |
|
143 | void shadesVisibleChanged(bool visible); | |
144 | void shadesColorChanged(QColor color); |
|
144 | void shadesColorChanged(QColor color); | |
145 | void shadesBorderColorChanged(QColor color); |
|
145 | void shadesBorderColorChanged(QColor color); | |
146 |
|
146 | |||
147 | protected: |
|
147 | protected: | |
148 | QScopedPointer<QAbstractAxisPrivate> d_ptr; |
|
148 | QScopedPointer<QAbstractAxisPrivate> d_ptr; | |
149 | Q_DISABLE_COPY(QAbstractAxis) |
|
149 | Q_DISABLE_COPY(QAbstractAxis) | |
150 | friend class ChartDataSet; |
|
150 | friend class ChartDataSet; | |
151 | friend class ChartAxis; |
|
151 | friend class ChartAxis; | |
152 | friend class ChartPresenter; |
|
152 | friend class ChartPresenter; | |
153 | }; |
|
153 | }; | |
154 |
|
154 | |||
155 | QTCOMMERCIALCHART_END_NAMESPACE |
|
155 | QTCOMMERCIALCHART_END_NAMESPACE | |
156 | #endif |
|
156 | ||
|
157 | #endif // QABSTRACTAXIS_H |
@@ -1,83 +1,83 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef ABSTRACTBARSERIES_H |
|
21 | #ifndef QABSTRACTBARSERIES_H | |
22 | #define ABSTRACTBARSERIES_H |
|
22 | #define QABSTRACTBARSERIES_H | |
23 |
|
23 | |||
24 | #include <qabstractseries.h> |
|
24 | #include <qabstractseries.h> | |
25 | #include <QStringList> |
|
25 | #include <QStringList> | |
26 |
|
26 | |||
27 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
27 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
28 |
|
28 | |||
29 | class QBarSet; |
|
29 | class QBarSet; | |
30 | class QAbstractBarSeriesPrivate; |
|
30 | class QAbstractBarSeriesPrivate; | |
31 |
|
31 | |||
32 | // Container for series |
|
32 | // Container for series | |
33 | class QTCOMMERCIALCHART_EXPORT QAbstractBarSeries : public QAbstractSeries |
|
33 | class QTCOMMERCIALCHART_EXPORT QAbstractBarSeries : public QAbstractSeries | |
34 | { |
|
34 | { | |
35 | Q_OBJECT |
|
35 | Q_OBJECT | |
36 | Q_PROPERTY(qreal barWidth READ barWidth WRITE setBarWidth) |
|
36 | Q_PROPERTY(qreal barWidth READ barWidth WRITE setBarWidth) | |
37 | Q_PROPERTY(int count READ count NOTIFY countChanged) |
|
37 | Q_PROPERTY(int count READ count NOTIFY countChanged) | |
38 | Q_PROPERTY(bool labelsVisible READ isLabelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged) |
|
38 | Q_PROPERTY(bool labelsVisible READ isLabelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged) | |
39 |
|
39 | |||
40 | public: |
|
40 | public: | |
41 | virtual ~QAbstractBarSeries(); |
|
41 | virtual ~QAbstractBarSeries(); | |
42 |
|
42 | |||
43 | void setBarWidth(qreal width); |
|
43 | void setBarWidth(qreal width); | |
44 | qreal barWidth() const; |
|
44 | qreal barWidth() const; | |
45 |
|
45 | |||
46 | bool append(QBarSet *set); |
|
46 | bool append(QBarSet *set); | |
47 | bool remove(QBarSet *set); |
|
47 | bool remove(QBarSet *set); | |
48 | bool take(QBarSet *set); |
|
48 | bool take(QBarSet *set); | |
49 | bool append(QList<QBarSet* > sets); |
|
49 | bool append(QList<QBarSet* > sets); | |
50 | bool insert(int index, QBarSet *set); |
|
50 | bool insert(int index, QBarSet *set); | |
51 | int count() const; |
|
51 | int count() const; | |
52 | QList<QBarSet*> barSets() const; |
|
52 | QList<QBarSet*> barSets() const; | |
53 | void clear(); |
|
53 | void clear(); | |
54 |
|
54 | |||
55 | void setLabelsVisible(bool visible = true); |
|
55 | void setLabelsVisible(bool visible = true); | |
56 | bool isLabelsVisible() const; |
|
56 | bool isLabelsVisible() const; | |
57 |
|
57 | |||
58 | protected: |
|
58 | protected: | |
59 | explicit QAbstractBarSeries(QAbstractBarSeriesPrivate &d,QObject *parent = 0); |
|
59 | explicit QAbstractBarSeries(QAbstractBarSeriesPrivate &d,QObject *parent = 0); | |
60 |
|
60 | |||
61 | Q_SIGNALS: |
|
61 | Q_SIGNALS: | |
62 | void clicked(int index, QBarSet *barset); |
|
62 | void clicked(int index, QBarSet *barset); | |
63 | void hovered(bool status, QBarSet *barset); |
|
63 | void hovered(bool status, QBarSet *barset); | |
64 | void countChanged(); |
|
64 | void countChanged(); | |
65 | void labelsVisibleChanged(); |
|
65 | void labelsVisibleChanged(); | |
66 |
|
66 | |||
67 | void barsetsAdded(QList<QBarSet*> sets); |
|
67 | void barsetsAdded(QList<QBarSet*> sets); | |
68 | void barsetsRemoved(QList<QBarSet*> sets); |
|
68 | void barsetsRemoved(QList<QBarSet*> sets); | |
69 |
|
69 | |||
70 | protected: |
|
70 | protected: | |
71 | Q_DECLARE_PRIVATE(QAbstractBarSeries) |
|
71 | Q_DECLARE_PRIVATE(QAbstractBarSeries) | |
72 | friend class AbstractBarChartItem; |
|
72 | friend class AbstractBarChartItem; | |
73 | friend class PercentBarChartItem; |
|
73 | friend class PercentBarChartItem; | |
74 | friend class StackedBarChartItem; |
|
74 | friend class StackedBarChartItem; | |
75 | friend class BarChartItem; |
|
75 | friend class BarChartItem; | |
76 | friend class HorizontalBarChartItem; |
|
76 | friend class HorizontalBarChartItem; | |
77 | friend class HorizontalStackedBarChartItem; |
|
77 | friend class HorizontalStackedBarChartItem; | |
78 | friend class HorizontalPercentBarChartItem; |
|
78 | friend class HorizontalPercentBarChartItem; | |
79 | }; |
|
79 | }; | |
80 |
|
80 | |||
81 | QTCOMMERCIALCHART_END_NAMESPACE |
|
81 | QTCOMMERCIALCHART_END_NAMESPACE | |
82 |
|
82 | |||
83 | #endif // ABSTRACTBARSERIES_H |
|
83 | #endif // QABSTRACTBARSERIES_H |
@@ -1,46 +1,46 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef PERCENTBARSERIES_H |
|
21 | #ifndef QPERCENTBARSERIES_H | |
22 | #define PERCENTBARSERIES_H |
|
22 | #define QPERCENTBARSERIES_H | |
23 |
|
23 | |||
24 | #include <QStringList> |
|
24 | #include <QStringList> | |
25 | #include <qabstractbarseries.h> |
|
25 | #include <qabstractbarseries.h> | |
26 |
|
26 | |||
27 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
27 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
28 |
|
28 | |||
29 | class QPercentBarSeriesPrivate; |
|
29 | class QPercentBarSeriesPrivate; | |
30 |
|
30 | |||
31 | class QTCOMMERCIALCHART_EXPORT QPercentBarSeries : public QAbstractBarSeries |
|
31 | class QTCOMMERCIALCHART_EXPORT QPercentBarSeries : public QAbstractBarSeries | |
32 | { |
|
32 | { | |
33 | Q_OBJECT |
|
33 | Q_OBJECT | |
34 | public: |
|
34 | public: | |
35 | explicit QPercentBarSeries(QObject *parent = 0); |
|
35 | explicit QPercentBarSeries(QObject *parent = 0); | |
36 | ~QPercentBarSeries(); |
|
36 | ~QPercentBarSeries(); | |
37 | QAbstractSeries::SeriesType type() const; |
|
37 | QAbstractSeries::SeriesType type() const; | |
38 |
|
38 | |||
39 | private: |
|
39 | private: | |
40 | Q_DECLARE_PRIVATE(QPercentBarSeries) |
|
40 | Q_DECLARE_PRIVATE(QPercentBarSeries) | |
41 | Q_DISABLE_COPY(QPercentBarSeries) |
|
41 | Q_DISABLE_COPY(QPercentBarSeries) | |
42 | }; |
|
42 | }; | |
43 |
|
43 | |||
44 | QTCOMMERCIALCHART_END_NAMESPACE |
|
44 | QTCOMMERCIALCHART_END_NAMESPACE | |
45 |
|
45 | |||
46 | #endif // PERCENTBARSERIES_H |
|
46 | #endif // QPERCENTBARSERIES_H |
@@ -1,46 +1,46 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef STACKEDBARSERIES_H |
|
21 | #ifndef QSTACKEDBARSERIES_H | |
22 | #define STACKEDBARSERIES_H |
|
22 | #define QSTACKEDBARSERIES_H | |
23 |
|
23 | |||
24 | #include <QStringList> |
|
24 | #include <QStringList> | |
25 | #include <qabstractbarseries.h> |
|
25 | #include <qabstractbarseries.h> | |
26 |
|
26 | |||
27 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
27 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
28 |
|
28 | |||
29 | class QStackedBarSeriesPrivate; |
|
29 | class QStackedBarSeriesPrivate; | |
30 |
|
30 | |||
31 | class QTCOMMERCIALCHART_EXPORT QStackedBarSeries : public QAbstractBarSeries |
|
31 | class QTCOMMERCIALCHART_EXPORT QStackedBarSeries : public QAbstractBarSeries | |
32 | { |
|
32 | { | |
33 | Q_OBJECT |
|
33 | Q_OBJECT | |
34 | public: |
|
34 | public: | |
35 | explicit QStackedBarSeries(QObject *parent = 0); |
|
35 | explicit QStackedBarSeries(QObject *parent = 0); | |
36 | ~QStackedBarSeries(); |
|
36 | ~QStackedBarSeries(); | |
37 | QAbstractSeries::SeriesType type() const; |
|
37 | QAbstractSeries::SeriesType type() const; | |
38 |
|
38 | |||
39 | private: |
|
39 | private: | |
40 | Q_DECLARE_PRIVATE(QStackedBarSeries) |
|
40 | Q_DECLARE_PRIVATE(QStackedBarSeries) | |
41 | Q_DISABLE_COPY(QStackedBarSeries) |
|
41 | Q_DISABLE_COPY(QStackedBarSeries) | |
42 | }; |
|
42 | }; | |
43 |
|
43 | |||
44 | QTCOMMERCIALCHART_END_NAMESPACE |
|
44 | QTCOMMERCIALCHART_END_NAMESPACE | |
45 |
|
45 | |||
46 | #endif // STACKEDBARSERIES_H |
|
46 | #endif // QSTACKEDBARSERIES_H |
@@ -1,52 +1,52 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef QLINESERIES_H |
|
21 | #ifndef QLINESERIES_H | |
22 | #define QLINESERIES_H |
|
22 | #define QLINESERIES_H | |
23 |
|
23 | |||
24 | #include <qchartglobal.h> |
|
24 | #include <qchartglobal.h> | |
25 | #include <qxyseries.h> |
|
25 | #include <qxyseries.h> | |
26 | #include <QPen> |
|
26 | #include <QPen> | |
27 |
|
27 | |||
28 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
28 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
29 |
|
29 | |||
30 | class QLineSeriesPrivate; |
|
30 | class QLineSeriesPrivate; | |
31 |
|
31 | |||
32 | class QTCOMMERCIALCHART_EXPORT QLineSeries : public QXYSeries |
|
32 | class QTCOMMERCIALCHART_EXPORT QLineSeries : public QXYSeries | |
33 | { |
|
33 | { | |
34 | Q_OBJECT |
|
34 | Q_OBJECT | |
35 |
|
35 | |||
36 | public: |
|
36 | public: | |
37 | explicit QLineSeries(QObject *parent = 0); |
|
37 | explicit QLineSeries(QObject *parent = 0); | |
38 | ~QLineSeries(); |
|
38 | ~QLineSeries(); | |
39 | QAbstractSeries::SeriesType type() const; |
|
39 | QAbstractSeries::SeriesType type() const; | |
40 |
|
40 | |||
41 | protected: |
|
41 | protected: | |
42 | QLineSeries(QLineSeriesPrivate &d,QObject *parent = 0); |
|
42 | QLineSeries(QLineSeriesPrivate &d,QObject *parent = 0); | |
43 |
|
43 | |||
44 | private: |
|
44 | private: | |
45 | Q_DECLARE_PRIVATE(QLineSeries) |
|
45 | Q_DECLARE_PRIVATE(QLineSeries) | |
46 | Q_DISABLE_COPY(QLineSeries) |
|
46 | Q_DISABLE_COPY(QLineSeries) | |
47 | friend class LineChartItem; |
|
47 | friend class LineChartItem; | |
48 | }; |
|
48 | }; | |
49 |
|
49 | |||
50 | QTCOMMERCIALCHART_END_NAMESPACE |
|
50 | QTCOMMERCIALCHART_END_NAMESPACE | |
51 |
|
51 | |||
52 | #endif |
|
52 | #endif // QLINESERIES_H |
@@ -1,102 +1,102 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef PIESERIES_H |
|
21 | #ifndef QPIESERIES_H | |
22 | #define PIESERIES_H |
|
22 | #define QPIESERIES_H | |
23 |
|
23 | |||
24 | #include <qabstractseries.h> |
|
24 | #include <qabstractseries.h> | |
25 | #include <QPieSlice> |
|
25 | #include <QPieSlice> | |
26 |
|
26 | |||
27 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
27 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
28 | class QPieSeriesPrivate; |
|
28 | class QPieSeriesPrivate; | |
29 |
|
29 | |||
30 | class QTCOMMERCIALCHART_EXPORT QPieSeries : public QAbstractSeries |
|
30 | class QTCOMMERCIALCHART_EXPORT QPieSeries : public QAbstractSeries | |
31 | { |
|
31 | { | |
32 | Q_OBJECT |
|
32 | Q_OBJECT | |
33 | Q_PROPERTY(qreal horizontalPosition READ horizontalPosition WRITE setHorizontalPosition) |
|
33 | Q_PROPERTY(qreal horizontalPosition READ horizontalPosition WRITE setHorizontalPosition) | |
34 | Q_PROPERTY(qreal verticalPosition READ verticalPosition WRITE setVerticalPosition) |
|
34 | Q_PROPERTY(qreal verticalPosition READ verticalPosition WRITE setVerticalPosition) | |
35 | Q_PROPERTY(qreal size READ pieSize WRITE setPieSize) |
|
35 | Q_PROPERTY(qreal size READ pieSize WRITE setPieSize) | |
36 | Q_PROPERTY(qreal startAngle READ pieStartAngle WRITE setPieStartAngle) |
|
36 | Q_PROPERTY(qreal startAngle READ pieStartAngle WRITE setPieStartAngle) | |
37 | Q_PROPERTY(qreal endAngle READ pieEndAngle WRITE setPieEndAngle) |
|
37 | Q_PROPERTY(qreal endAngle READ pieEndAngle WRITE setPieEndAngle) | |
38 | Q_PROPERTY(int count READ count NOTIFY countChanged) |
|
38 | Q_PROPERTY(int count READ count NOTIFY countChanged) | |
39 | Q_PROPERTY(qreal sum READ sum NOTIFY sumChanged) |
|
39 | Q_PROPERTY(qreal sum READ sum NOTIFY sumChanged) | |
40 | Q_PROPERTY(qreal holeSize READ holeSize WRITE setHoleSize) |
|
40 | Q_PROPERTY(qreal holeSize READ holeSize WRITE setHoleSize) | |
41 |
|
41 | |||
42 | public: |
|
42 | public: | |
43 | explicit QPieSeries(QObject *parent = 0); |
|
43 | explicit QPieSeries(QObject *parent = 0); | |
44 | virtual ~QPieSeries(); |
|
44 | virtual ~QPieSeries(); | |
45 |
|
45 | |||
46 | QAbstractSeries::SeriesType type() const; |
|
46 | QAbstractSeries::SeriesType type() const; | |
47 |
|
47 | |||
48 | bool append(QPieSlice* slice); |
|
48 | bool append(QPieSlice* slice); | |
49 | bool append(QList<QPieSlice*> slices); |
|
49 | bool append(QList<QPieSlice*> slices); | |
50 | QPieSeries& operator << (QPieSlice* slice); |
|
50 | QPieSeries& operator << (QPieSlice* slice); | |
51 | QPieSlice* append(QString label, qreal value); |
|
51 | QPieSlice* append(QString label, qreal value); | |
52 |
|
52 | |||
53 | bool insert(int index, QPieSlice* slice); |
|
53 | bool insert(int index, QPieSlice* slice); | |
54 |
|
54 | |||
55 | bool remove(QPieSlice* slice); |
|
55 | bool remove(QPieSlice* slice); | |
56 | bool take(QPieSlice* slice); |
|
56 | bool take(QPieSlice* slice); | |
57 | void clear(); |
|
57 | void clear(); | |
58 |
|
58 | |||
59 | QList<QPieSlice*> slices() const; |
|
59 | QList<QPieSlice*> slices() const; | |
60 | int count() const; |
|
60 | int count() const; | |
61 |
|
61 | |||
62 | bool isEmpty() const; |
|
62 | bool isEmpty() const; | |
63 |
|
63 | |||
64 | qreal sum() const; |
|
64 | qreal sum() const; | |
65 |
|
65 | |||
66 | void setHoleSize(qreal holeSize); |
|
66 | void setHoleSize(qreal holeSize); | |
67 | qreal holeSize() const; |
|
67 | qreal holeSize() const; | |
68 |
|
68 | |||
69 | void setHorizontalPosition(qreal relativePosition); |
|
69 | void setHorizontalPosition(qreal relativePosition); | |
70 | qreal horizontalPosition() const; |
|
70 | qreal horizontalPosition() const; | |
71 |
|
71 | |||
72 | void setVerticalPosition(qreal relativePosition); |
|
72 | void setVerticalPosition(qreal relativePosition); | |
73 | qreal verticalPosition() const; |
|
73 | qreal verticalPosition() const; | |
74 |
|
74 | |||
75 | void setPieSize(qreal relativeSize); |
|
75 | void setPieSize(qreal relativeSize); | |
76 | qreal pieSize() const; |
|
76 | qreal pieSize() const; | |
77 |
|
77 | |||
78 | void setPieStartAngle(qreal startAngle); |
|
78 | void setPieStartAngle(qreal startAngle); | |
79 | qreal pieStartAngle() const; |
|
79 | qreal pieStartAngle() const; | |
80 |
|
80 | |||
81 | void setPieEndAngle(qreal endAngle); |
|
81 | void setPieEndAngle(qreal endAngle); | |
82 | qreal pieEndAngle() const; |
|
82 | qreal pieEndAngle() const; | |
83 |
|
83 | |||
84 | void setLabelsVisible(bool visible = true); |
|
84 | void setLabelsVisible(bool visible = true); | |
85 | void setLabelsPosition(QPieSlice::LabelPosition position); |
|
85 | void setLabelsPosition(QPieSlice::LabelPosition position); | |
86 |
|
86 | |||
87 | Q_SIGNALS: |
|
87 | Q_SIGNALS: | |
88 | void added(QList<QPieSlice*> slices); |
|
88 | void added(QList<QPieSlice*> slices); | |
89 | void removed(QList<QPieSlice*> slices); |
|
89 | void removed(QList<QPieSlice*> slices); | |
90 | void clicked(QPieSlice* slice); |
|
90 | void clicked(QPieSlice* slice); | |
91 | void hovered(QPieSlice* slice, bool state); |
|
91 | void hovered(QPieSlice* slice, bool state); | |
92 | void countChanged(); |
|
92 | void countChanged(); | |
93 | void sumChanged(); |
|
93 | void sumChanged(); | |
94 |
|
94 | |||
95 | private: |
|
95 | private: | |
96 | Q_DECLARE_PRIVATE(QPieSeries) |
|
96 | Q_DECLARE_PRIVATE(QPieSeries) | |
97 | Q_DISABLE_COPY(QPieSeries) |
|
97 | Q_DISABLE_COPY(QPieSeries) | |
98 | }; |
|
98 | }; | |
99 |
|
99 | |||
100 | QTCOMMERCIALCHART_END_NAMESPACE |
|
100 | QTCOMMERCIALCHART_END_NAMESPACE | |
101 |
|
101 | |||
102 | #endif // PIESERIES_H |
|
102 | #endif // QPIESERIES_H |
@@ -1,87 +1,87 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef QABSTRACTSERIES_H |
|
21 | #ifndef QABSTRACTSERIES_H | |
22 | #define QABSTRACTSERIES_H |
|
22 | #define QABSTRACTSERIES_H | |
23 |
|
23 | |||
24 | #include <qchartglobal.h> |
|
24 | #include <qchartglobal.h> | |
25 | #include <qabstractaxis.h> |
|
25 | #include <qabstractaxis.h> | |
26 | #include <QObject> |
|
26 | #include <QObject> | |
27 | #include <QPen> |
|
27 | #include <QPen> | |
28 |
|
28 | |||
29 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
29 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
30 |
|
30 | |||
31 | class QAbstractSeriesPrivate; |
|
31 | class QAbstractSeriesPrivate; | |
32 | class QChart; |
|
32 | class QChart; | |
33 |
|
33 | |||
34 | class QTCOMMERCIALCHART_EXPORT QAbstractSeries : public QObject |
|
34 | class QTCOMMERCIALCHART_EXPORT QAbstractSeries : public QObject | |
35 | { |
|
35 | { | |
36 | Q_OBJECT |
|
36 | Q_OBJECT | |
37 | Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) |
|
37 | Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) | |
38 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) |
|
38 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) | |
39 | Q_PROPERTY(SeriesType type READ type) |
|
39 | Q_PROPERTY(SeriesType type READ type) | |
40 | Q_ENUMS(SeriesType) |
|
40 | Q_ENUMS(SeriesType) | |
41 |
|
41 | |||
42 | public: |
|
42 | public: | |
43 | enum SeriesType { |
|
43 | enum SeriesType { | |
44 | SeriesTypeLine, |
|
44 | SeriesTypeLine, | |
45 | SeriesTypeArea, |
|
45 | SeriesTypeArea, | |
46 | SeriesTypeBar, |
|
46 | SeriesTypeBar, | |
47 | SeriesTypeStackedBar, |
|
47 | SeriesTypeStackedBar, | |
48 | SeriesTypePercentBar, |
|
48 | SeriesTypePercentBar, | |
49 | SeriesTypePie, |
|
49 | SeriesTypePie, | |
50 | SeriesTypeScatter, |
|
50 | SeriesTypeScatter, | |
51 | SeriesTypeSpline, |
|
51 | SeriesTypeSpline, | |
52 | SeriesTypeHorizontalBar, |
|
52 | SeriesTypeHorizontalBar, | |
53 | SeriesTypeHorizontalStackedBar, |
|
53 | SeriesTypeHorizontalStackedBar, | |
54 | SeriesTypeHorizontalPercentBar |
|
54 | SeriesTypeHorizontalPercentBar | |
55 | }; |
|
55 | }; | |
56 |
|
56 | |||
57 | protected: |
|
57 | protected: | |
58 | QAbstractSeries(QAbstractSeriesPrivate &d, QObject *parent = 0); |
|
58 | QAbstractSeries(QAbstractSeriesPrivate &d, QObject *parent = 0); | |
59 |
|
59 | |||
60 | public: |
|
60 | public: | |
61 | ~QAbstractSeries(); |
|
61 | ~QAbstractSeries(); | |
62 | virtual SeriesType type() const = 0; |
|
62 | virtual SeriesType type() const = 0; | |
63 |
|
63 | |||
64 | void setName(const QString& name); |
|
64 | void setName(const QString& name); | |
65 | QString name() const; |
|
65 | QString name() const; | |
66 | void setVisible(bool visible = true); |
|
66 | void setVisible(bool visible = true); | |
67 | bool isVisible() const; |
|
67 | bool isVisible() const; | |
68 | QChart* chart() const; |
|
68 | QChart* chart() const; | |
69 |
|
69 | |||
70 | void show(); |
|
70 | void show(); | |
71 | void hide(); |
|
71 | void hide(); | |
72 |
|
72 | |||
73 | Q_SIGNALS: |
|
73 | Q_SIGNALS: | |
74 | void nameChanged(); |
|
74 | void nameChanged(); | |
75 | void visibleChanged(); |
|
75 | void visibleChanged(); | |
76 |
|
76 | |||
77 | protected: |
|
77 | protected: | |
78 | QScopedPointer<QAbstractSeriesPrivate> d_ptr; |
|
78 | QScopedPointer<QAbstractSeriesPrivate> d_ptr; | |
79 | friend class ChartDataSet; |
|
79 | friend class ChartDataSet; | |
80 | friend class ChartPresenter; |
|
80 | friend class ChartPresenter; | |
81 | friend class QLegendPrivate; |
|
81 | friend class QLegendPrivate; | |
82 | friend class DeclarativeChart; |
|
82 | friend class DeclarativeChart; | |
83 | }; |
|
83 | }; | |
84 |
|
84 | |||
85 | QTCOMMERCIALCHART_END_NAMESPACE |
|
85 | QTCOMMERCIALCHART_END_NAMESPACE | |
86 |
|
86 | |||
87 | #endif |
|
87 | #endif // QABSTRACTSERIES_H |
@@ -1,133 +1,133 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef QCHART_H |
|
21 | #ifndef QCHART_H | |
22 | #define QCHART_H |
|
22 | #define QCHART_H | |
23 |
|
23 | |||
24 | #include <QAbstractSeries> |
|
24 | #include <QAbstractSeries> | |
25 | #include <QLegend> |
|
25 | #include <QLegend> | |
26 | #include <QGraphicsWidget> |
|
26 | #include <QGraphicsWidget> | |
27 | #include <QMargins> |
|
27 | #include <QMargins> | |
28 |
|
28 | |||
29 | class QGraphicsSceneResizeEvent; |
|
29 | class QGraphicsSceneResizeEvent; | |
30 |
|
30 | |||
31 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
31 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
32 |
|
32 | |||
33 | class QAbstractSeries; |
|
33 | class QAbstractSeries; | |
34 | class QAbstractAxis; |
|
34 | class QAbstractAxis; | |
35 | class QLegend; |
|
35 | class QLegend; | |
36 | struct QChartPrivate; |
|
36 | struct QChartPrivate; | |
37 |
|
37 | |||
38 | class QTCOMMERCIALCHART_EXPORT QChart : public QGraphicsWidget |
|
38 | class QTCOMMERCIALCHART_EXPORT QChart : public QGraphicsWidget | |
39 | { |
|
39 | { | |
40 | Q_OBJECT |
|
40 | Q_OBJECT | |
41 | Q_PROPERTY(QChart::ChartTheme theme READ theme WRITE setTheme) |
|
41 | Q_PROPERTY(QChart::ChartTheme theme READ theme WRITE setTheme) | |
42 | Q_PROPERTY(QString title READ title WRITE setTitle) |
|
42 | Q_PROPERTY(QString title READ title WRITE setTitle) | |
43 | Q_PROPERTY(bool backgroundVisible READ isBackgroundVisible WRITE setBackgroundVisible) |
|
43 | Q_PROPERTY(bool backgroundVisible READ isBackgroundVisible WRITE setBackgroundVisible) | |
44 | Q_PROPERTY(bool dropShadowEnabled READ isDropShadowEnabled WRITE setDropShadowEnabled) |
|
44 | Q_PROPERTY(bool dropShadowEnabled READ isDropShadowEnabled WRITE setDropShadowEnabled) | |
45 | Q_PROPERTY(QChart::AnimationOptions animationOptions READ animationOptions WRITE setAnimationOptions) |
|
45 | Q_PROPERTY(QChart::AnimationOptions animationOptions READ animationOptions WRITE setAnimationOptions) | |
46 | Q_PROPERTY(QMargins margins READ margins WRITE setMargins) |
|
46 | Q_PROPERTY(QMargins margins READ margins WRITE setMargins) | |
47 | Q_ENUMS(ChartTheme) |
|
47 | Q_ENUMS(ChartTheme) | |
48 | Q_ENUMS(AnimationOption) |
|
48 | Q_ENUMS(AnimationOption) | |
49 |
|
49 | |||
50 | public: |
|
50 | public: | |
51 | enum ChartTheme { |
|
51 | enum ChartTheme { | |
52 | ChartThemeLight = 0, |
|
52 | ChartThemeLight = 0, | |
53 | ChartThemeBlueCerulean, |
|
53 | ChartThemeBlueCerulean, | |
54 | ChartThemeDark, |
|
54 | ChartThemeDark, | |
55 | ChartThemeBrownSand, |
|
55 | ChartThemeBrownSand, | |
56 | ChartThemeBlueNcs, |
|
56 | ChartThemeBlueNcs, | |
57 | ChartThemeHighContrast, |
|
57 | ChartThemeHighContrast, | |
58 | ChartThemeBlueIcy |
|
58 | ChartThemeBlueIcy | |
59 | }; |
|
59 | }; | |
60 |
|
60 | |||
61 | enum AnimationOption { |
|
61 | enum AnimationOption { | |
62 | NoAnimation = 0x0, |
|
62 | NoAnimation = 0x0, | |
63 | GridAxisAnimations = 0x1, |
|
63 | GridAxisAnimations = 0x1, | |
64 | SeriesAnimations =0x2, |
|
64 | SeriesAnimations =0x2, | |
65 | AllAnimations = 0x3 |
|
65 | AllAnimations = 0x3 | |
66 | }; |
|
66 | }; | |
67 |
|
67 | |||
68 | Q_DECLARE_FLAGS(AnimationOptions, AnimationOption) |
|
68 | Q_DECLARE_FLAGS(AnimationOptions, AnimationOption) | |
69 |
|
69 | |||
70 | public: |
|
70 | public: | |
71 | explicit QChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0); |
|
71 | explicit QChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0); | |
72 | ~QChart(); |
|
72 | ~QChart(); | |
73 |
|
73 | |||
74 | void addSeries(QAbstractSeries *series); |
|
74 | void addSeries(QAbstractSeries *series); | |
75 | void removeSeries(QAbstractSeries *series); |
|
75 | void removeSeries(QAbstractSeries *series); | |
76 | void removeAllSeries(); |
|
76 | void removeAllSeries(); | |
77 | QList<QAbstractSeries*> series() const; |
|
77 | QList<QAbstractSeries*> series() const; | |
78 |
|
78 | |||
79 | void setAxisX(QAbstractAxis* axis, QAbstractSeries *series = 0); |
|
79 | void setAxisX(QAbstractAxis* axis, QAbstractSeries *series = 0); | |
80 | void setAxisY(QAbstractAxis* axis, QAbstractSeries *series = 0); |
|
80 | void setAxisY(QAbstractAxis* axis, QAbstractSeries *series = 0); | |
81 |
|
81 | |||
82 | QAbstractAxis* axisX(QAbstractSeries* series = 0) const; |
|
82 | QAbstractAxis* axisX(QAbstractSeries* series = 0) const; | |
83 | QAbstractAxis* axisY(QAbstractSeries* series = 0) const; |
|
83 | QAbstractAxis* axisY(QAbstractSeries* series = 0) const; | |
84 |
|
84 | |||
85 | void createDefaultAxes(); |
|
85 | void createDefaultAxes(); | |
86 |
|
86 | |||
87 | void setTheme(QChart::ChartTheme theme); |
|
87 | void setTheme(QChart::ChartTheme theme); | |
88 | QChart::ChartTheme theme() const; |
|
88 | QChart::ChartTheme theme() const; | |
89 |
|
89 | |||
90 | void setTitle(const QString& title); |
|
90 | void setTitle(const QString& title); | |
91 | QString title() const; |
|
91 | QString title() const; | |
92 | void setTitleFont(const QFont& font); |
|
92 | void setTitleFont(const QFont& font); | |
93 | QFont titleFont() const; |
|
93 | QFont titleFont() const; | |
94 | void setTitleBrush(const QBrush &brush); |
|
94 | void setTitleBrush(const QBrush &brush); | |
95 | QBrush titleBrush() const; |
|
95 | QBrush titleBrush() const; | |
96 |
|
96 | |||
97 | void setBackgroundBrush(const QBrush &brush); |
|
97 | void setBackgroundBrush(const QBrush &brush); | |
98 | QBrush backgroundBrush() const; |
|
98 | QBrush backgroundBrush() const; | |
99 | void setBackgroundPen(const QPen &pen); |
|
99 | void setBackgroundPen(const QPen &pen); | |
100 | QPen backgroundPen() const; |
|
100 | QPen backgroundPen() const; | |
101 | void setBackgroundVisible(bool visible = true); |
|
101 | void setBackgroundVisible(bool visible = true); | |
102 | bool isBackgroundVisible() const; |
|
102 | bool isBackgroundVisible() const; | |
103 |
|
103 | |||
104 | void setDropShadowEnabled(bool enabled = true); |
|
104 | void setDropShadowEnabled(bool enabled = true); | |
105 | bool isDropShadowEnabled() const; |
|
105 | bool isDropShadowEnabled() const; | |
106 | void setAnimationOptions(AnimationOptions options); |
|
106 | void setAnimationOptions(AnimationOptions options); | |
107 | AnimationOptions animationOptions() const; |
|
107 | AnimationOptions animationOptions() const; | |
108 |
|
108 | |||
109 | void zoomIn(); |
|
109 | void zoomIn(); | |
110 | void zoomIn(const QRectF &rect); |
|
110 | void zoomIn(const QRectF &rect); | |
111 | void zoomOut(); |
|
111 | void zoomOut(); | |
112 | void zoom(qreal factor); |
|
112 | void zoom(qreal factor); | |
113 | void scroll(qreal dx, qreal dy); |
|
113 | void scroll(qreal dx, qreal dy); | |
114 |
|
114 | |||
115 | QLegend* legend() const; |
|
115 | QLegend* legend() const; | |
116 |
|
116 | |||
117 | void setMargins(const QMargins& margins); |
|
117 | void setMargins(const QMargins& margins); | |
118 | QMargins margins() const; |
|
118 | QMargins margins() const; | |
119 |
|
119 | |||
120 | QRectF plotArea() const; |
|
120 | QRectF plotArea() const; | |
121 |
|
121 | |||
122 | protected: |
|
122 | protected: | |
123 | QScopedPointer<QChartPrivate> d_ptr; |
|
123 | QScopedPointer<QChartPrivate> d_ptr; | |
124 | friend class QLegend; |
|
124 | friend class QLegend; | |
125 | friend class ChartPresenter; |
|
125 | friend class ChartPresenter; | |
126 | Q_DISABLE_COPY(QChart) |
|
126 | Q_DISABLE_COPY(QChart) | |
127 | }; |
|
127 | }; | |
128 |
|
128 | |||
129 | QTCOMMERCIALCHART_END_NAMESPACE |
|
129 | QTCOMMERCIALCHART_END_NAMESPACE | |
130 |
|
130 | |||
131 | Q_DECLARE_OPERATORS_FOR_FLAGS(QTCOMMERCIALCHART_NAMESPACE::QChart::AnimationOptions) |
|
131 | Q_DECLARE_OPERATORS_FOR_FLAGS(QTCOMMERCIALCHART_NAMESPACE::QChart::AnimationOptions) | |
132 |
|
132 | |||
133 | #endif |
|
133 | #endif // QCHART_H |
@@ -1,79 +1,79 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef CHARTGLOBAL_H |
|
21 | #ifndef QCHARTGLOBAL_H | |
22 | #define CHARTGLOBAL_H |
|
22 | #define QCHARTGLOBAL_H | |
23 |
|
23 | |||
24 | #define QTCOMMERCIALCHART_VERSION_STR "1.0" |
|
24 | #define QTCOMMERCIALCHART_VERSION_STR "1.0" | |
25 | #define QTCOMMERCIALCHART_VERSION 0x01 |
|
25 | #define QTCOMMERCIALCHART_VERSION 0x01 | |
26 |
|
26 | |||
27 | #if defined(QTCOMMERCIALCHART_LIBRARY) |
|
27 | #if defined(QTCOMMERCIALCHART_LIBRARY) | |
28 | # define QTCOMMERCIALCHART_EXPORT Q_DECL_EXPORT |
|
28 | # define QTCOMMERCIALCHART_EXPORT Q_DECL_EXPORT | |
29 | #else |
|
29 | #else | |
30 | # define QTCOMMERCIALCHART_EXPORT Q_DECL_IMPORT |
|
30 | # define QTCOMMERCIALCHART_EXPORT Q_DECL_IMPORT | |
31 | #endif |
|
31 | #endif | |
32 |
|
32 | |||
33 | #if defined(BUILD_PRIVATE_UNIT_TESTS) && defined(QTCOMMERCIALCHART_LIBRARY) |
|
33 | #if defined(BUILD_PRIVATE_UNIT_TESTS) && defined(QTCOMMERCIALCHART_LIBRARY) | |
34 | # define QTCOMMERCIALCHART_AUTOTEST_EXPORT Q_DECL_EXPORT |
|
34 | # define QTCOMMERCIALCHART_AUTOTEST_EXPORT Q_DECL_EXPORT | |
35 | #elif defined(BUILD_PRIVATE_UNIT_TESTS) && !defined(QTCOMMERCIALCHART_LIBRARY) |
|
35 | #elif defined(BUILD_PRIVATE_UNIT_TESTS) && !defined(QTCOMMERCIALCHART_LIBRARY) | |
36 | # define QTCOMMERCIALCHART_AUTOTEST_EXPORT Q_DECL_IMPORT |
|
36 | # define QTCOMMERCIALCHART_AUTOTEST_EXPORT Q_DECL_IMPORT | |
37 | #else |
|
37 | #else | |
38 | # define QTCOMMERCIALCHART_AUTOTEST_EXPORT |
|
38 | # define QTCOMMERCIALCHART_AUTOTEST_EXPORT | |
39 | #endif |
|
39 | #endif | |
40 |
|
40 | |||
41 | #ifdef QTCOMMERCIALCHART_STATICLIB |
|
41 | #ifdef QTCOMMERCIALCHART_STATICLIB | |
42 | # undef QTCOMMERCIALCHART_EXPORT |
|
42 | # undef QTCOMMERCIALCHART_EXPORT | |
43 | # undef QTCOMMERCIALCHART_AUTOTEST_EXPORT |
|
43 | # undef QTCOMMERCIALCHART_AUTOTEST_EXPORT | |
44 | # define QTCOMMERCIALCHART_EXPORT |
|
44 | # define QTCOMMERCIALCHART_EXPORT | |
45 | # define QTCOMMERCIALCHART_AUTOTEST_EXPORT |
|
45 | # define QTCOMMERCIALCHART_AUTOTEST_EXPORT | |
46 | #endif |
|
46 | #endif | |
47 |
|
47 | |||
48 | #define QTCOMMERCIALCHART_NAMESPACE QtCommercialChart |
|
48 | #define QTCOMMERCIALCHART_NAMESPACE QtCommercialChart | |
49 |
|
49 | |||
50 | #ifdef QTCOMMERCIALCHART_NAMESPACE |
|
50 | #ifdef QTCOMMERCIALCHART_NAMESPACE | |
51 | # define QTCOMMERCIALCHART_BEGIN_NAMESPACE namespace QTCOMMERCIALCHART_NAMESPACE { |
|
51 | # define QTCOMMERCIALCHART_BEGIN_NAMESPACE namespace QTCOMMERCIALCHART_NAMESPACE { | |
52 | # define QTCOMMERCIALCHART_END_NAMESPACE } |
|
52 | # define QTCOMMERCIALCHART_END_NAMESPACE } | |
53 | # define QTCOMMERCIALCHART_USE_NAMESPACE using namespace QTCOMMERCIALCHART_NAMESPACE; |
|
53 | # define QTCOMMERCIALCHART_USE_NAMESPACE using namespace QTCOMMERCIALCHART_NAMESPACE; | |
54 | #else |
|
54 | #else | |
55 | # define QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
55 | # define QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
56 | # define QTCOMMERCIALCHART_END_NAMESPACE |
|
56 | # define QTCOMMERCIALCHART_END_NAMESPACE | |
57 | # define QTCOMMERCIALCHART_USE_NAMESPACE |
|
57 | # define QTCOMMERCIALCHART_USE_NAMESPACE | |
58 | #endif |
|
58 | #endif | |
59 |
|
59 | |||
60 | #if defined(DEVELOPMENT_BUILD) && !defined(QT_NO_DEBUG) |
|
60 | #if defined(DEVELOPMENT_BUILD) && !defined(QT_NO_DEBUG) | |
61 | #include <stdarg.h> |
|
61 | #include <stdarg.h> | |
62 | #include <QDebug> |
|
62 | #include <QDebug> | |
63 |
|
63 | |||
64 | #define CHART_DEBUG chartDebug(3,__LINE__,__FILE__,__FUNCTION__) |
|
64 | #define CHART_DEBUG chartDebug(3,__LINE__,__FILE__,__FUNCTION__) | |
65 |
|
65 | |||
66 | static inline QDebug chartDebug(int numargs,...) |
|
66 | static inline QDebug chartDebug(int numargs,...) | |
67 | { |
|
67 | { | |
68 | va_list valist; |
|
68 | va_list valist; | |
69 | va_start(valist,numargs); |
|
69 | va_start(valist,numargs); | |
70 | //for( int i = 0 ; i < numargs; i++ ) |
|
70 | //for( int i = 0 ; i < numargs; i++ ) | |
71 | int line=va_arg(valist,int); |
|
71 | int line=va_arg(valist,int); | |
72 | char* file=va_arg(valist,char*); |
|
72 | char* file=va_arg(valist,char*); | |
73 | char* function=va_arg(valist,char*); |
|
73 | char* function=va_arg(valist,char*); | |
74 | va_end(valist); |
|
74 | va_end(valist); | |
75 | return qDebug()<<QString().append(function).append("(").append(file).append(":%1)").arg(line); |
|
75 | return qDebug()<<QString().append(function).append("(").append(file).append(":%1)").arg(line); | |
76 | } |
|
76 | } | |
77 | #endif |
|
77 | #endif | |
78 |
|
78 | |||
79 | #endif // CHARTGLOBAL_H |
|
79 | #endif // QCHARTGLOBAL_H |
@@ -1,72 +1,72 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef QCHARTVIEW_H |
|
21 | #ifndef QCHARTVIEW_H | |
22 | #define QCHARTVIEW_H |
|
22 | #define QCHARTVIEW_H | |
23 |
|
23 | |||
24 | #include <QAbstractAxis> |
|
24 | #include <QAbstractAxis> | |
25 | #include <QAbstractSeries> |
|
25 | #include <QAbstractSeries> | |
26 | #include <QChart> |
|
26 | #include <QChart> | |
27 | #include <QGraphicsView> |
|
27 | #include <QGraphicsView> | |
28 |
|
28 | |||
29 | class QGraphicsScene; |
|
29 | class QGraphicsScene; | |
30 | class QRubberBand; |
|
30 | class QRubberBand; | |
31 |
|
31 | |||
32 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
32 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
33 |
|
33 | |||
34 | class QChartViewPrivate; |
|
34 | class QChartViewPrivate; | |
35 |
|
35 | |||
36 | class QTCOMMERCIALCHART_EXPORT QChartView : public QGraphicsView |
|
36 | class QTCOMMERCIALCHART_EXPORT QChartView : public QGraphicsView | |
37 | { |
|
37 | { | |
38 | Q_OBJECT |
|
38 | Q_OBJECT | |
39 | Q_ENUMS(RubberBand) |
|
39 | Q_ENUMS(RubberBand) | |
40 | public: |
|
40 | public: | |
41 |
|
41 | |||
42 | enum RubberBand{ |
|
42 | enum RubberBand{ | |
43 | NoRubberBand = 0x0, |
|
43 | NoRubberBand = 0x0, | |
44 | VerticalRubberBand = 0x1, |
|
44 | VerticalRubberBand = 0x1, | |
45 | HorizonalRubberBand = 0x2, |
|
45 | HorizonalRubberBand = 0x2, | |
46 | RectangleRubberBand = 0x3 |
|
46 | RectangleRubberBand = 0x3 | |
47 | }; |
|
47 | }; | |
48 |
|
48 | |||
49 | Q_DECLARE_FLAGS(RubberBands, RubberBand) |
|
49 | Q_DECLARE_FLAGS(RubberBands, RubberBand) | |
50 |
|
50 | |||
51 | explicit QChartView(QWidget *parent = 0); |
|
51 | explicit QChartView(QWidget *parent = 0); | |
52 | explicit QChartView(QChart *chart,QWidget *parent = 0); |
|
52 | explicit QChartView(QChart *chart,QWidget *parent = 0); | |
53 | ~QChartView(); |
|
53 | ~QChartView(); | |
54 |
|
54 | |||
55 | void setRubberBand(const RubberBands& rubberBands); |
|
55 | void setRubberBand(const RubberBands& rubberBands); | |
56 | RubberBands rubberBand() const; |
|
56 | RubberBands rubberBand() const; | |
57 | QChart* chart() const; |
|
57 | QChart* chart() const; | |
58 |
|
58 | |||
59 | protected: |
|
59 | protected: | |
60 | void resizeEvent(QResizeEvent *event); |
|
60 | void resizeEvent(QResizeEvent *event); | |
61 | void mousePressEvent(QMouseEvent *event); |
|
61 | void mousePressEvent(QMouseEvent *event); | |
62 | void mouseMoveEvent(QMouseEvent *event); |
|
62 | void mouseMoveEvent(QMouseEvent *event); | |
63 | void mouseReleaseEvent(QMouseEvent *event); |
|
63 | void mouseReleaseEvent(QMouseEvent *event); | |
64 |
|
64 | |||
65 | protected: |
|
65 | protected: | |
66 | QScopedPointer<QChartViewPrivate> d_ptr; |
|
66 | QScopedPointer<QChartViewPrivate> d_ptr; | |
67 | Q_DISABLE_COPY(QChartView) |
|
67 | Q_DISABLE_COPY(QChartView) | |
68 | }; |
|
68 | }; | |
69 |
|
69 | |||
70 | QTCOMMERCIALCHART_END_NAMESPACE |
|
70 | QTCOMMERCIALCHART_END_NAMESPACE | |
71 |
|
71 | |||
72 |
#endif // QCHART |
|
72 | #endif // QCHARTVIEW_H |
@@ -1,94 +1,94 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef QXYSERIES_H |
|
21 | #ifndef QXYSERIES_H | |
22 | #define QXYSERIES_H |
|
22 | #define QXYSERIES_H | |
23 |
|
23 | |||
24 | #include <qchartglobal.h> |
|
24 | #include <qchartglobal.h> | |
25 | #include <qabstractseries.h> |
|
25 | #include <qabstractseries.h> | |
26 | #include <QPen> |
|
26 | #include <QPen> | |
27 | #include <QBrush> |
|
27 | #include <QBrush> | |
28 |
|
28 | |||
29 | class QModelIndex; |
|
29 | class QModelIndex; | |
30 |
|
30 | |||
31 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
31 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
32 |
|
32 | |||
33 | class QXYSeriesPrivate; |
|
33 | class QXYSeriesPrivate; | |
34 | class QXYModelMapper; |
|
34 | class QXYModelMapper; | |
35 |
|
35 | |||
36 | class QTCOMMERCIALCHART_EXPORT QXYSeries : public QAbstractSeries |
|
36 | class QTCOMMERCIALCHART_EXPORT QXYSeries : public QAbstractSeries | |
37 | { |
|
37 | { | |
38 | Q_OBJECT |
|
38 | Q_OBJECT | |
39 | Q_PROPERTY(bool pointsVisible READ pointsVisible WRITE setPointsVisible) |
|
39 | Q_PROPERTY(bool pointsVisible READ pointsVisible WRITE setPointsVisible) | |
40 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) |
|
40 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) | |
41 |
|
41 | |||
42 | protected: |
|
42 | protected: | |
43 | explicit QXYSeries(QXYSeriesPrivate &d,QObject *parent = 0); |
|
43 | explicit QXYSeries(QXYSeriesPrivate &d,QObject *parent = 0); | |
44 |
|
44 | |||
45 | public: |
|
45 | public: | |
46 | ~QXYSeries(); |
|
46 | ~QXYSeries(); | |
47 | void append(qreal x, qreal y); |
|
47 | void append(qreal x, qreal y); | |
48 | void append(const QPointF &point); |
|
48 | void append(const QPointF &point); | |
49 | void append(const QList<QPointF> &points); |
|
49 | void append(const QList<QPointF> &points); | |
50 | void replace(qreal oldX,qreal oldY,qreal newX,qreal newY); |
|
50 | void replace(qreal oldX,qreal oldY,qreal newX,qreal newY); | |
51 | void replace(const QPointF &oldPoint,const QPointF &newPoint); |
|
51 | void replace(const QPointF &oldPoint,const QPointF &newPoint); | |
52 | void remove(qreal x, qreal y); |
|
52 | void remove(qreal x, qreal y); | |
53 | void remove(const QPointF &point); |
|
53 | void remove(const QPointF &point); | |
54 | void insert(int index, const QPointF &point); |
|
54 | void insert(int index, const QPointF &point); | |
55 | void clear(); |
|
55 | void clear(); | |
56 |
|
56 | |||
57 | int count() const; |
|
57 | int count() const; | |
58 | QList<QPointF> points() const; |
|
58 | QList<QPointF> points() const; | |
59 |
|
59 | |||
60 | QXYSeries& operator << (const QPointF &point); |
|
60 | QXYSeries& operator << (const QPointF &point); | |
61 | QXYSeries& operator << (const QList<QPointF> &points); |
|
61 | QXYSeries& operator << (const QList<QPointF> &points); | |
62 |
|
62 | |||
63 | virtual void setPen(const QPen &pen); |
|
63 | virtual void setPen(const QPen &pen); | |
64 | QPen pen() const; |
|
64 | QPen pen() const; | |
65 |
|
65 | |||
66 | virtual void setBrush(const QBrush &brush); |
|
66 | virtual void setBrush(const QBrush &brush); | |
67 | QBrush brush() const; |
|
67 | QBrush brush() const; | |
68 |
|
68 | |||
69 | virtual void setColor(const QColor &color); |
|
69 | virtual void setColor(const QColor &color); | |
70 | virtual QColor color() const; |
|
70 | virtual QColor color() const; | |
71 |
|
71 | |||
72 | void setPointsVisible(bool visible = true); |
|
72 | void setPointsVisible(bool visible = true); | |
73 | bool pointsVisible() const; |
|
73 | bool pointsVisible() const; | |
74 |
|
74 | |||
75 | void replace(QList<QPointF> points); |
|
75 | void replace(QList<QPointF> points); | |
76 |
|
76 | |||
77 | Q_SIGNALS: |
|
77 | Q_SIGNALS: | |
78 | void clicked(const QPointF &point); |
|
78 | void clicked(const QPointF &point); | |
79 | void pointReplaced(int index); |
|
79 | void pointReplaced(int index); | |
80 | void pointRemoved(int index); |
|
80 | void pointRemoved(int index); | |
81 | void pointAdded(int index); |
|
81 | void pointAdded(int index); | |
82 | void colorChanged(QColor color); |
|
82 | void colorChanged(QColor color); | |
83 | void pointsReplaced(); |
|
83 | void pointsReplaced(); | |
84 |
|
84 | |||
85 | private: |
|
85 | private: | |
86 | Q_DECLARE_PRIVATE(QXYSeries) |
|
86 | Q_DECLARE_PRIVATE(QXYSeries) | |
87 | Q_DISABLE_COPY(QXYSeries) |
|
87 | Q_DISABLE_COPY(QXYSeries) | |
88 | friend class XYLegendMarker; |
|
88 | friend class XYLegendMarker; | |
89 | friend class XYChart; |
|
89 | friend class XYChart; | |
90 | }; |
|
90 | }; | |
91 |
|
91 | |||
92 | QTCOMMERCIALCHART_END_NAMESPACE |
|
92 | QTCOMMERCIALCHART_END_NAMESPACE | |
93 |
|
93 | |||
94 | #endif |
|
94 | #endif // QXYSERIES_H |
General Comments 0
You need to be logged in to leave comments.
Login now