@@ -20,11 +20,10 | |||||
20 |
|
20 | |||
21 | #include <QtGui/QApplication> |
|
21 | #include <QtGui/QApplication> | |
22 | #include <QMainWindow> |
|
22 | #include <QMainWindow> | |
23 | #include <qchartglobal.h> |
|
|||
24 | #include <qchartview.h> |
|
|||
25 | #include <qpieseries.h> |
|
|||
26 | #include <qpieslice.h> |
|
|||
27 | #include <QTime> |
|
23 | #include <QTime> | |
|
24 | #include <QChartView> | |||
|
25 | #include <QPieSeries> | |||
|
26 | #include <QPieSlice> | |||
28 |
|
27 | |||
29 | QTCOMMERCIALCHART_USE_NAMESPACE |
|
28 | QTCOMMERCIALCHART_USE_NAMESPACE | |
30 |
|
29 |
@@ -19,13 +19,11 | |||||
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #include "splinewidget.h" |
|
21 | #include "splinewidget.h" | |
22 | #include "qchartview.h" |
|
|||
23 | #include "qlineseries.h" |
|
|||
24 | #include <QGridLayout> |
|
22 | #include <QGridLayout> | |
25 | #include <QPushButton> |
|
23 | #include <QPushButton> | |
26 | #include "qchartaxis.h" |
|
|||
27 | #include <qmath.h> |
|
|||
28 | #include <QTime> |
|
24 | #include <QTime> | |
|
25 | #include <QChartView> | |||
|
26 | #include <QSplineSeries> | |||
29 |
|
27 | |||
30 | QTCOMMERCIALCHART_USE_NAMESPACE |
|
28 | QTCOMMERCIALCHART_USE_NAMESPACE | |
31 |
|
29 |
@@ -20,13 +20,9 | |||||
20 |
|
20 | |||
21 | #include <QtGui/QApplication> |
|
21 | #include <QtGui/QApplication> | |
22 | #include <QMainWindow> |
|
22 | #include <QMainWindow> | |
23 |
#include < |
|
23 | #include <QChartView> | |
24 |
#include < |
|
24 | #include <QStackedBarSeries> | |
25 | #include <qstackedbarseries.h> |
|
25 | #include <QBarSet> | |
26 | #include <qbarset.h> |
|
|||
27 | #include <qchartaxis.h> |
|
|||
28 | #include <QStringList> |
|
|||
29 | #include <QDebug> |
|
|||
30 |
|
26 | |||
31 | QTCOMMERCIALCHART_USE_NAMESPACE |
|
27 | QTCOMMERCIALCHART_USE_NAMESPACE | |
32 |
|
28 | |||
@@ -35,7 +31,11 class DrilldownBarSeries : public QStackedBarSeries | |||||
35 | { |
|
31 | { | |
36 | Q_OBJECT |
|
32 | Q_OBJECT | |
37 | public: |
|
33 | public: | |
38 |
DrilldownBarSeries(QStringList categories, QObject *parent = 0) |
|
34 | DrilldownBarSeries(QStringList categories, QObject *parent = 0) | |
|
35 | :QStackedBarSeries(categories, parent) | |||
|
36 | { | |||
|
37 | ||||
|
38 | } | |||
39 |
|
39 | |||
40 | void mapDrilldownSeries(QString category, DrilldownBarSeries* drilldownSeries) |
|
40 | void mapDrilldownSeries(QString category, DrilldownBarSeries* drilldownSeries) | |
41 | { |
|
41 | { | |
@@ -47,10 +47,7 public: | |||||
47 | return mDrilldownSeries[category]; |
|
47 | return mDrilldownSeries[category]; | |
48 | } |
|
48 | } | |
49 |
|
49 | |||
50 | public Q_SLOTS: |
|
|||
51 |
|
||||
52 | private: |
|
50 | private: | |
53 |
|
||||
54 | QMap<QString, DrilldownBarSeries*> mDrilldownSeries; |
|
51 | QMap<QString, DrilldownBarSeries*> mDrilldownSeries; | |
55 | }; |
|
52 | }; | |
56 | //! [1] |
|
53 | //! [1] | |
@@ -60,7 +57,12 class DrilldownChart : public QChart | |||||
60 | { |
|
57 | { | |
61 | Q_OBJECT |
|
58 | Q_OBJECT | |
62 | public: |
|
59 | public: | |
63 |
explicit DrilldownChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0) |
|
60 | explicit DrilldownChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0) | |
|
61 | :QChart(parent, wFlags), | |||
|
62 | m_currentSeries(0) | |||
|
63 | { | |||
|
64 | ||||
|
65 | } | |||
64 |
|
66 | |||
65 | void changeSeries(QSeries* series) |
|
67 | void changeSeries(QSeries* series) | |
66 | { |
|
68 | { | |
@@ -75,6 +77,7 public Q_SLOTS: | |||||
75 | void handleClicked(QBarSet *barset, QString category, Qt::MouseButtons button) |
|
77 | void handleClicked(QBarSet *barset, QString category, Qt::MouseButtons button) | |
76 | { |
|
78 | { | |
77 | Q_UNUSED(barset) |
|
79 | Q_UNUSED(barset) | |
|
80 | Q_UNUSED(button) | |||
78 | DrilldownBarSeries* series = static_cast<DrilldownBarSeries*> (sender()); |
|
81 | DrilldownBarSeries* series = static_cast<DrilldownBarSeries*> (sender()); | |
79 | changeSeries(series->drilldownSeries(category)); |
|
82 | changeSeries(series->drilldownSeries(category)); | |
80 | } |
|
83 | } |
General Comments 0
You need to be logged in to leave comments.
Login now