@@ -53,7 +53,7 public: | |||
|
53 | 53 | removeSeries(m_currentSeries); |
|
54 | 54 | m_currentSeries = series; |
|
55 | 55 | addSeries(series); |
|
56 |
setChartTitle(series-> |
|
|
56 | setChartTitle(series->name()); | |
|
57 | 57 | } |
|
58 | 58 | |
|
59 | 59 | public Q_SLOTS: |
@@ -81,7 +81,7 int main(int argc, char *argv[]) | |||
|
81 | 81 | drilldownChart->setAnimationOptions(QChart::AllAnimations); |
|
82 | 82 | |
|
83 | 83 | QPieSeries* yearSeries = new QPieSeries(&window); |
|
84 |
yearSeries->set |
|
|
84 | yearSeries->setName("Sales by year - All"); | |
|
85 | 85 | |
|
86 | 86 | QList<QString> months; |
|
87 | 87 | months << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun" << "Jul" << "Aug" << "Sep" << "Oct" << "Nov" << "Dec"; |
@@ -90,7 +90,7 int main(int argc, char *argv[]) | |||
|
90 | 90 | |
|
91 | 91 | foreach (QString name, names) { |
|
92 | 92 | QPieSeries* series = new QPieSeries(&window); |
|
93 |
series->set |
|
|
93 | series->setName("Sales by month - " + name); | |
|
94 | 94 | |
|
95 | 95 | foreach (QString month, months) |
|
96 | 96 | *series << new DrilldownSlice(qrand() % 1000, month, yearSeries); |
@@ -48,7 +48,7 public: | |||
|
48 | 48 | removeSeries(m_currentSeries); |
|
49 | 49 | m_currentSeries = series; |
|
50 | 50 | addSeries(series); |
|
51 |
setChartTitle(series-> |
|
|
51 | setChartTitle(series->name()); | |
|
52 | 52 | } |
|
53 | 53 | |
|
54 | 54 | public Q_SLOTS: |
@@ -85,7 +85,7 int main(int argc, char *argv[]) | |||
|
85 | 85 | //! [4] |
|
86 | 86 | // Create drilldown structure |
|
87 | 87 | DrilldownBarSeries* seasonSeries = new DrilldownBarSeries(months, drilldownChart); |
|
88 |
seasonSeries->set |
|
|
88 | seasonSeries->setName("Crop by month - Season"); | |
|
89 | 89 | |
|
90 | 90 | // Each month in season series has drilldown series for weekly data |
|
91 | 91 | foreach (QString month, months) { |
@@ -97,7 +97,7 int main(int argc, char *argv[]) | |||
|
97 | 97 | // Drilling down from weekly data brings us back to season data. |
|
98 | 98 | foreach (QString week, weeks) { |
|
99 | 99 | weeklySeries->mapDrilldownSeries(week, seasonSeries); |
|
100 |
weeklySeries->set |
|
|
100 | weeklySeries->setName(QString("Crop by week - " + month)); | |
|
101 | 101 | } |
|
102 | 102 | |
|
103 | 103 | // Use right click signal to implement drilldown |
@@ -134,7 +134,7 int main(int argc, char *argv[]) | |||
|
134 | 134 | //! [6] |
|
135 | 135 | // Show season series in initial view |
|
136 | 136 | drilldownChart->changeSeries(seasonSeries); |
|
137 |
drilldownChart->setChartTitle(seasonSeries-> |
|
|
137 | drilldownChart->setChartTitle(seasonSeries->name()); | |
|
138 | 138 | //! [6] |
|
139 | 139 | |
|
140 | 140 | drilldownChart->axisX()->setGridLineVisible(false); |
General Comments 0
You need to be logged in to leave comments.
Login now