@@ -38,14 +38,16 public: | |||
|
38 | 38 | QValueAxis *valueaxis = new QValueAxis(); |
|
39 | 39 | QDateTimeAxis *datetimeaxis = new QDateTimeAxis(); |
|
40 | 40 | datetimeaxis->setTickCount(10); |
|
41 |
datetimeaxis->setFormat(" |
|
|
41 | datetimeaxis->setFormat("yyyy"); | |
|
42 | 42 | |
|
43 | 43 | QString name("Series "); |
|
44 | 44 | int nameIndex = 0; |
|
45 | 45 | foreach (DataList list, table) { |
|
46 | 46 | QLineSeries *series = new QLineSeries(chart); |
|
47 | foreach (Data data, list) | |
|
48 |
|
|
|
47 | foreach (Data data, list){ | |
|
48 | QPointF point = data.first; | |
|
49 | series->append(1000l*60l*60l*24l*365l*30l+point.x()*1000l*60l*60l*24l*365l,point.y()); | |
|
50 | } | |
|
49 | 51 | series->setName(name + QString::number(nameIndex)); |
|
50 | 52 | nameIndex++; |
|
51 | 53 | chart->addSeries(series); |
General Comments 0
You need to be logged in to leave comments.
Login now