@@ -168,8 +168,9 void MainWidget::addSeries(QString series, QString data) | |||
|
168 | 168 | |
|
169 | 169 | // BarChart |
|
170 | 170 | if (series == "Bar") { |
|
171 | // This is the another way of creating series. Should we create test cases for both ways, if we support them? | |
|
171 | 172 | qDebug() << "Bar chart series"; |
|
172 |
|
|
|
173 | newSeries = QChartSeries::create(QChartSeries::SeriesTypeBar, this); | |
|
173 | 174 | QList<int> barData; |
|
174 | 175 | barData << 1; |
|
175 | 176 | barData << 12; |
@@ -177,9 +178,8 void MainWidget::addSeries(QString series, QString data) | |||
|
177 | 178 | barData << 8; |
|
178 | 179 | barData << 17; |
|
179 | 180 | barData << 9; |
|
180 |
|
|
|
181 |
m_chartWidget->addSeries( |
|
|
182 | ||
|
181 | newSeries->setData(barData); | |
|
182 | m_chartWidget->addSeries(newSeries); | |
|
183 | 183 | } |
|
184 | 184 | |
|
185 | 185 | setCurrentSeries(newSeries); |
@@ -195,6 +195,9 void MainWidget::setCurrentSeries(QChartSeries *series) | |||
|
195 | 195 | break; |
|
196 | 196 | case QChartSeries::SeriesTypePie: |
|
197 | 197 | break; |
|
198 | case QChartSeries::SeriesTypeBar: | |
|
199 | qDebug() << "setCurrentSeries (bar)"; | |
|
200 | break; | |
|
198 | 201 | default: |
|
199 | 202 | Q_ASSERT(false); |
|
200 | 203 | break; |
General Comments 0
You need to be logged in to leave comments.
Login now