diff --git a/doc/src/examples-groupedbarchart.qdoc b/doc/src/examples-groupedbarchart.qdoc index fb31db5..f3a75b9 100644 --- a/doc/src/examples-groupedbarchart.qdoc +++ b/doc/src/examples-groupedbarchart.qdoc @@ -21,7 +21,7 @@ \snippet ../examples/groupedbarchart/main.cpp 3 - We define the categories here and add them to the x-axis. + We define the categories here and add them to QCategoriesAxis which we then set to be the x-axis of the chart. \snippet ../examples/groupedbarchart/main.cpp 4 diff --git a/examples/groupedbarchart/main.cpp b/examples/groupedbarchart/main.cpp index 175380d..9d2b908 100644 --- a/examples/groupedbarchart/main.cpp +++ b/examples/groupedbarchart/main.cpp @@ -60,6 +60,7 @@ int main(int argc, char *argv[]) QChart* chart = new QChart(); chart->addSeries(series); chart->setTitle("Simple grouped barchart example"); + chart->createDefaultAxes(); //![3] //![4] @@ -67,7 +68,7 @@ int main(int argc, char *argv[]) categories << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun"; QCategoriesAxis* axis = new QCategoriesAxis(); axis->append(categories); - chart->createDefaultAxes(); + chart->setAxisX(axis,series); //![4] //![5] diff --git a/examples/stackedbarchart/main.cpp b/examples/stackedbarchart/main.cpp index f97da22..70f2694 100644 --- a/examples/stackedbarchart/main.cpp +++ b/examples/stackedbarchart/main.cpp @@ -59,6 +59,7 @@ int main(int argc, char *argv[]) QChart* chart = new QChart(); chart->addSeries(series); chart->setTitle("Simple stackedbarchart example"); + chart->createDefaultAxes(); //![3] //![4]