@@ -1,85 +1,86 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2012 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 Commercial Charts Add-on. |
|
8 | 8 | ** |
|
9 | 9 | ** $QT_BEGIN_LICENSE$ |
|
10 | 10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
11 | 11 | ** accordance with the Qt Commercial 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 QABSTRACTSERIES_H |
|
22 | 22 | #define QABSTRACTSERIES_H |
|
23 | 23 | |
|
24 | 24 | #include <qchartglobal.h> |
|
25 | 25 | #include <qabstractaxis.h> |
|
26 | 26 | #include <QObject> |
|
27 | 27 | #include <QPen> |
|
28 | 28 | |
|
29 | 29 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
30 | 30 | |
|
31 | 31 | class QAbstractSeriesPrivate; |
|
32 | 32 | class QChart; |
|
33 | 33 | |
|
34 | 34 | class QTCOMMERCIALCHART_EXPORT QAbstractSeries : public QObject |
|
35 | 35 | { |
|
36 | 36 | Q_OBJECT |
|
37 | 37 | Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) |
|
38 | 38 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) |
|
39 | 39 | Q_PROPERTY(SeriesType type READ type) |
|
40 | 40 | Q_ENUMS(SeriesType) |
|
41 | 41 | |
|
42 | 42 | public: |
|
43 | 43 | enum SeriesType { |
|
44 | 44 | SeriesTypeLine, |
|
45 | 45 | SeriesTypeArea, |
|
46 | 46 | SeriesTypeBar, |
|
47 | 47 | SeriesTypeStackedBar, |
|
48 | 48 | SeriesTypePercentBar, |
|
49 | 49 | SeriesTypePie, |
|
50 | 50 | SeriesTypeScatter, |
|
51 | 51 | SeriesTypeSpline, |
|
52 | 52 | SeriesTypeHorizontalBar |
|
53 | ||
|
53 | SeriesTypeHorizontalStackedBar, | |
|
54 | SeriesTypeHorizontalPercentBar | |
|
54 | 55 | }; |
|
55 | 56 | |
|
56 | 57 | protected: |
|
57 | 58 | QAbstractSeries(QAbstractSeriesPrivate &d, QObject *parent = 0); |
|
58 | 59 | |
|
59 | 60 | public: |
|
60 | 61 | ~QAbstractSeries(); |
|
61 | 62 | virtual SeriesType type() const = 0; |
|
62 | 63 | |
|
63 | 64 | void setName(const QString& name); |
|
64 | 65 | QString name() const; |
|
65 | 66 | void setVisible(bool visible = true); |
|
66 | 67 | bool isVisible() const; |
|
67 | 68 | QChart* chart() const; |
|
68 | 69 | |
|
69 | 70 | void show(); |
|
70 | 71 | void hide(); |
|
71 | 72 | |
|
72 | 73 | Q_SIGNALS: |
|
73 | 74 | void nameChanged(); |
|
74 | 75 | void visibleChanged(); |
|
75 | 76 | |
|
76 | 77 | protected: |
|
77 | 78 | QScopedPointer<QAbstractSeriesPrivate> d_ptr; |
|
78 | 79 | friend class ChartDataSet; |
|
79 | 80 | friend class ChartPresenter; |
|
80 | 81 | friend class QLegendPrivate; |
|
81 | 82 | }; |
|
82 | 83 | |
|
83 | 84 | QTCOMMERCIALCHART_END_NAMESPACE |
|
84 | 85 | |
|
85 | 86 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now