@@ -21,7 +21,7 | |||
|
21 | 21 | |
|
22 | 22 | \snippet ../examples/groupedbarchart/main.cpp 3 |
|
23 | 23 | |
|
24 | We define the categories here and add them to the x-axis. | |
|
24 | We define the categories here and add them to QCategoriesAxis which we then set to be the x-axis of the chart. | |
|
25 | 25 | |
|
26 | 26 | \snippet ../examples/groupedbarchart/main.cpp 4 |
|
27 | 27 |
@@ -60,6 +60,7 int main(int argc, char *argv[]) | |||
|
60 | 60 | QChart* chart = new QChart(); |
|
61 | 61 | chart->addSeries(series); |
|
62 | 62 | chart->setTitle("Simple grouped barchart example"); |
|
63 | chart->createDefaultAxes(); | |
|
63 | 64 | //![3] |
|
64 | 65 | |
|
65 | 66 | //![4] |
@@ -67,7 +68,7 int main(int argc, char *argv[]) | |||
|
67 | 68 | categories << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun"; |
|
68 | 69 | QCategoriesAxis* axis = new QCategoriesAxis(); |
|
69 | 70 | axis->append(categories); |
|
70 | chart->createDefaultAxes(); | |
|
71 | chart->setAxisX(axis,series); | |
|
71 | 72 | //![4] |
|
72 | 73 | |
|
73 | 74 | //![5] |
General Comments 0
You need to be logged in to leave comments.
Login now