From 41924dd7d5144a37117762afd87e0d0c08f41407 2012-06-05 11:23:12 From: sauimone Date: 2012-06-05 11:23:12 Subject: [PATCH] barchart documentation update --- diff --git a/doc/src/examples-barchart.qdoc b/doc/src/examples-barchart.qdoc index 289a328..2fc81da 100644 --- a/doc/src/examples-barchart.qdoc +++ b/doc/src/examples-barchart.qdoc @@ -8,7 +8,8 @@ \image examples_barchart.png Data that barchart visualizes, is defined by QBarSet instances. Here we create some sets and append data - we want to visualize to them. Note that first and third QPointF in each set have smaller intervals at their x coordinates. This will be reflected in the chart. + we want to visualize to them. Note that x positions are not in even intervals and this will be reflected in the chart. + If x positions aren't defined, then the index of value is assumed to be x position. \snippet ../examples/barchart/main.cpp 1 @@ -17,6 +18,7 @@ \snippet ../examples/barchart/main.cpp 2 Next we create a chart and add the series to it. + We also set the title for chart \snippet ../examples/barchart/main.cpp 3 diff --git a/doc/src/examples-groupedbarchart.qdoc b/doc/src/examples-groupedbarchart.qdoc index 79eded3..fb31db5 100644 --- a/doc/src/examples-groupedbarchart.qdoc +++ b/doc/src/examples-groupedbarchart.qdoc @@ -6,23 +6,22 @@ The example shows how to create simple bar chart. GroupedBarChart shows the data in sets as separate bars, which are grouped in categories. \image examples_groupedbarchart.png - - First we define categories. + + Data that groupedbarchart visualizes, is defined by QBarSet instances. Here we create the sets and append data + to them. \snippet ../examples/groupedbarchart/main.cpp 1 - Data that groupedbarchart visualizes, is defined by QBarSet instances. Here we create some sets and append data - we want to visualize to them. + We create the series and append the sets to it. The grouped barseries groups the data from sets to categories. + First value of each set are gropuped together at first category second value to second category and so on. \snippet ../examples/groupedbarchart/main.cpp 2 - To combine the sets and categories to a chart, we need to create QBarSeries instance. When creating - the QBarSeries, the categories must be known. Sets can be added later. For example purposes the sets - are added to series here. + Then we create a chart and add the series to it. \snippet ../examples/groupedbarchart/main.cpp 3 - Then we create a chart and add the series to it. + We define the categories here and add them to the x-axis. \snippet ../examples/groupedbarchart/main.cpp 4 diff --git a/examples/barchart/main.cpp b/examples/barchart/main.cpp index 0813aa0..4e39e6e 100644 --- a/examples/barchart/main.cpp +++ b/examples/barchart/main.cpp @@ -55,7 +55,7 @@ int main(int argc, char *argv[]) //![3] QChart* chart = new QChart(); chart->addSeries(series); - chart->setTitle("Simple barchart example"); + chart->setTitle("Barchart example"); //![3] //![4] diff --git a/examples/groupedbarchart/main.cpp b/examples/groupedbarchart/main.cpp index 80a3a93..a31e51c 100644 --- a/examples/groupedbarchart/main.cpp +++ b/examples/groupedbarchart/main.cpp @@ -47,7 +47,6 @@ int main(int argc, char *argv[]) //![2] QGroupedBarSeries* series = new QGroupedBarSeries(); -// series->setCategories(categories); series->append(set0); series->append(set1); series->append(set2);