@@ -66,7 +66,6 int main(int argc, char *argv[]) | |||
|
66 | 66 | QChart *chart = new QChart(); |
|
67 | 67 | chart->addSeries(series); |
|
68 | 68 | chart->legend()->hide(); |
|
69 | chart->createDefaultAxes(); | |
|
70 | 69 | chart->setTitle("Sunspots count (by Space Weather Prediction Center)"); |
|
71 | 70 | //![3] |
|
72 | 71 | |
@@ -75,8 +74,14 int main(int argc, char *argv[]) | |||
|
75 | 74 | axisX->setTickCount(10); |
|
76 | 75 | axisX->setFormat("MMM yyyy"); |
|
77 | 76 | axisX->setTitleText("Date"); |
|
78 |
chart-> |
|
|
79 | chart->axisY(series)->setTitleText("Sunspots count"); | |
|
77 | chart->addAxis(axisX, Qt::AlignBottom); | |
|
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 | 85 | //![4] |
|
81 | 86 | |
|
82 | 87 | //![5] |
General Comments 0
You need to be logged in to leave comments.
Login now