##// END OF EJS Templates
datetimeaxis example vertical axis format set to integers
Marek Rosa -
r2332:e54231dffb7f
parent child
Show More
@@ -66,7 +66,6 int main(int argc, char *argv[])
66 QChart *chart = new QChart();
66 QChart *chart = new QChart();
67 chart->addSeries(series);
67 chart->addSeries(series);
68 chart->legend()->hide();
68 chart->legend()->hide();
69 chart->createDefaultAxes();
70 chart->setTitle("Sunspots count (by Space Weather Prediction Center)");
69 chart->setTitle("Sunspots count (by Space Weather Prediction Center)");
71 //![3]
70 //![3]
72
71
@@ -75,8 +74,14 int main(int argc, char *argv[])
75 axisX->setTickCount(10);
74 axisX->setTickCount(10);
76 axisX->setFormat("MMM yyyy");
75 axisX->setFormat("MMM yyyy");
77 axisX->setTitleText("Date");
76 axisX->setTitleText("Date");
78 chart->setAxisX(axisX, series);
77 chart->addAxis(axisX, Qt::AlignBottom);
79 chart->axisY(series)->setTitleText("Sunspots count");
78 series->attachAxis(axisX);
79
80 QValueAxis *axisY = new QValueAxis;
81 axisY->setLabelFormat("%i");
82 axisY->setTitleText("Sunspots count");
83 chart->addAxis(axisY, Qt::AlignLeft);
84 series->attachAxis(axisY);
80 //![4]
85 //![4]
81
86
82 //![5]
87 //![5]
General Comments 0
You need to be logged in to leave comments. Login now