##// END OF EJS Templates
Chartthemes example to use increasing x values
Tero Ahola -
r515:3aac91920670
parent child
Show More
@@ -39,10 +39,10 public:
39 int listCount = 3;
39 int listCount = 3;
40 int valueMax = 100;
40 int valueMax = 100;
41 int valueCount = 50;
41 int valueCount = 50;
42 for (int i=0; i<listCount; i++) {
42 for (int i(0); i < listCount; i++) {
43 DataList dataList;
43 DataList dataList;
44 for (int j=0; j<valueCount; j++) {
44 for (int j(0); j < valueCount; j++) {
45 QPointF value(qrand() % valueMax, qrand() % valueMax);
45 QPointF value(j + (qreal) rand() / (qreal) RAND_MAX, qrand() % valueMax);
46 QString label = QString::number(i) + ":" + QString::number(j);
46 QString label = QString::number(i) + ":" + QString::number(j);
47 dataList << Data(value, label);
47 dataList << Data(value, label);
48 }
48 }
@@ -110,7 +110,7 public:
110 for (int i=0; i<m_dataTable.count(); i++) {
110 for (int i=0; i<m_dataTable.count(); i++) {
111 QPieSeries *series = new QPieSeries(chart);
111 QPieSeries *series = new QPieSeries(chart);
112 foreach (Data data, m_dataTable[i])
112 foreach (Data data, m_dataTable[i])
113 series->add(data.first.x(), data.second);
113 series->add(data.first.y(), data.second);
114 qreal hPos = (pieSize / 2) + (i / (qreal) m_dataTable.count());
114 qreal hPos = (pieSize / 2) + (i / (qreal) m_dataTable.count());
115 series->setPieSize(pieSize);
115 series->setPieSize(pieSize);
116 series->setPiePosition(hPos, 0.5);
116 series->setPiePosition(hPos, 0.5);
General Comments 0
You need to be logged in to leave comments. Login now