@@ -11,7 +11,7 SUBDIRS += \ | |||
|
11 | 11 | #multichart \ |
|
12 | 12 | percentbarchart \ |
|
13 | 13 | piechart \ |
|
14 |
|
|
|
14 | piechartdrilldown \ | |
|
15 | 15 | #presenterchart \ |
|
16 | 16 | scatterchart \ |
|
17 | 17 | #scatterinteractions \ |
@@ -39,11 +39,11 private: | |||
|
39 | 39 | QString m_prefix; |
|
40 | 40 | }; |
|
41 | 41 | |
|
42 |
class DrilldownChart : public QChart |
|
|
42 | class DrilldownChart : public QChart | |
|
43 | 43 | { |
|
44 | 44 | Q_OBJECT |
|
45 | 45 | public: |
|
46 |
explicit DrilldownChart(Q |
|
|
46 | explicit DrilldownChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0):QChart(parent, wFlags), m_currentSeries(0) {} | |
|
47 | 47 | |
|
48 | 48 | void changeSeries(QSeries* series) |
|
49 | 49 | { |
@@ -53,7 +53,7 public: | |||
|
53 | 53 | removeSeries(m_currentSeries); |
|
54 | 54 | m_currentSeries = series; |
|
55 | 55 | addSeries(series); |
|
56 |
set |
|
|
56 | setTitle(series->name()); | |
|
57 | 57 | } |
|
58 | 58 | |
|
59 | 59 | public Q_SLOTS: |
@@ -75,9 +75,8 int main(int argc, char *argv[]) | |||
|
75 | 75 | |
|
76 | 76 | QMainWindow window; |
|
77 | 77 | |
|
78 |
DrilldownChart* drilldownChart = new DrilldownChart( |
|
|
79 |
drilldownChart->set |
|
|
80 | drilldownChart->setChartTheme(QChart::ChartThemeLight); | |
|
78 | DrilldownChart* drilldownChart = new DrilldownChart(); | |
|
79 | drilldownChart->setTheme(QChart::ChartThemeLight); | |
|
81 | 80 | drilldownChart->setAnimationOptions(QChart::AllAnimations); |
|
82 | 81 | |
|
83 | 82 | QPieSeries* yearSeries = new QPieSeries(&window); |
@@ -104,7 +103,9 int main(int argc, char *argv[]) | |||
|
104 | 103 | |
|
105 | 104 | drilldownChart->changeSeries(yearSeries); |
|
106 | 105 | |
|
107 | window.setCentralWidget(drilldownChart); | |
|
106 | QChartView* chartView = new QChartView(drilldownChart); | |
|
107 | chartView->setRenderHint(QPainter::Antialiasing); | |
|
108 | window.setCentralWidget(chartView); | |
|
108 | 109 | window.resize(800, 600); |
|
109 | 110 | window.show(); |
|
110 | 111 |
General Comments 0
You need to be logged in to leave comments.
Login now