##// END OF EJS Templates
Theme example sets and slices renamed (shown if legend enabled)
Tero Ahola -
r945:d3dafb2d19ed
parent child
Show More
@@ -129,7 +129,7 DataTable ThemeWidget::generateRandomData(int listCount,int valueMax,int valueCo
129 yValue = yValue + (qreal) (qrand() % valueMax) / (qreal) valueCount;
129 yValue = yValue + (qreal) (qrand() % valueMax) / (qreal) valueCount;
130 QPointF value((j + (qreal) rand() / (qreal) RAND_MAX) * ((qreal) m_valueMax / (qreal) valueCount),
130 QPointF value((j + (qreal) rand() / (qreal) RAND_MAX) * ((qreal) m_valueMax / (qreal) valueCount),
131 yValue);
131 yValue);
132 QString label = "Item " + QString::number(i) + ":" + QString::number(j);
132 QString label = "Slice " + QString::number(i) + ":" + QString::number(j);
133 dataList << Data(value, label);
133 dataList << Data(value, label);
134 }
134 }
135 dataTable << dataList;
135 dataTable << dataList;
@@ -219,7 +219,7 QChart* ThemeWidget::createBarChart(int valueCount) const
219 // QPercentBarSeries* series = new QPercentBarSeries(categories, chart);
219 // QPercentBarSeries* series = new QPercentBarSeries(categories, chart);
220 QStackedBarSeries* series = new QStackedBarSeries(categories, chart);
220 QStackedBarSeries* series = new QStackedBarSeries(categories, chart);
221 for (int i(0); i < m_dataTable.count(); i++) {
221 for (int i(0); i < m_dataTable.count(); i++) {
222 QBarSet *set = new QBarSet("Set" + QString::number(i));
222 QBarSet *set = new QBarSet("Bar set " + QString::number(i));
223 foreach (Data data, m_dataTable[i])
223 foreach (Data data, m_dataTable[i])
224 *set << data.first.y();
224 *set << data.first.y();
225 series->appendBarSet(set);
225 series->appendBarSet(set);
General Comments 0
You need to be logged in to leave comments. Login now