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