@@ -38,14 +38,16 public: | |||||
38 | QValueAxis *valueaxis = new QValueAxis(); |
|
38 | QValueAxis *valueaxis = new QValueAxis(); | |
39 | QDateTimeAxis *datetimeaxis = new QDateTimeAxis(); |
|
39 | QDateTimeAxis *datetimeaxis = new QDateTimeAxis(); | |
40 | datetimeaxis->setTickCount(10); |
|
40 | datetimeaxis->setTickCount(10); | |
41 |
datetimeaxis->setFormat(" |
|
41 | datetimeaxis->setFormat("yyyy"); | |
42 |
|
42 | |||
43 | QString name("Series "); |
|
43 | QString name("Series "); | |
44 | int nameIndex = 0; |
|
44 | int nameIndex = 0; | |
45 | foreach (DataList list, table) { |
|
45 | foreach (DataList list, table) { | |
46 | QLineSeries *series = new QLineSeries(chart); |
|
46 | QLineSeries *series = new QLineSeries(chart); | |
47 | foreach (Data data, list) |
|
47 | foreach (Data data, list){ | |
48 |
|
|
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 | series->setName(name + QString::number(nameIndex)); |
|
51 | series->setName(name + QString::number(nameIndex)); | |
50 | nameIndex++; |
|
52 | nameIndex++; | |
51 | chart->addSeries(series); |
|
53 | chart->addSeries(series); |
@@ -23,6 +23,7 | |||||
23 | #include "chartdatetimeaxisx_p.h" |
|
23 | #include "chartdatetimeaxisx_p.h" | |
24 | #include "chartdatetimeaxisy_p.h" |
|
24 | #include "chartdatetimeaxisy_p.h" | |
25 | #include "domain_p.h" |
|
25 | #include "domain_p.h" | |
|
26 | #include <float.h> | |||
26 | #include <cmath> |
|
27 | #include <cmath> | |
27 |
|
28 | |||
28 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
29 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
General Comments 0
You need to be logged in to leave comments.
Login now