##// END OF EJS Templates
Updated bar chart documentation
Tero Ahola -
r971:29cedae3d4be
parent child
Show More
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: file renamed from doc/images/example_zoomlinechart1.png to doc/images/examples_zoomlinechart1.png
NO CONTENT: file renamed from doc/images/example_zoomlinechart1.png to doc/images/examples_zoomlinechart1.png
1 NO CONTENT: file renamed from doc/images/example_zoomlinechart2.png to doc/images/examples_zoomlinechart2.png
NO CONTENT: file renamed from doc/images/example_zoomlinechart2.png to doc/images/examples_zoomlinechart2.png
@@ -5,14 +5,14
5
5
6 The example shows how to create simple bar chart. Barchart shows the data in sets as separate bars, which are grouped in categories.
6 The example shows how to create simple bar chart. Barchart shows the data in sets as separate bars, which are grouped in categories.
7
7
8 \image barchart.png
8 \image examples_barchart.png
9
9
10 First we define categories.
10 First we define categories.
11
11
12 \snippet ../examples/barchart/main.cpp 1
12 \snippet ../examples/barchart/main.cpp 1
13
13
14 Data that barchart visualizes, is defined by QBarSet instances. Here we create some sets and append data
14 Data that barchart visualizes, is defined by QBarSet instances. Here we create some sets and append data
15 we want to visulaize to them.
15 we want to visualize to them.
16
16
17 \snippet ../examples/barchart/main.cpp 2
17 \snippet ../examples/barchart/main.cpp 2
18
18
@@ -22,18 +22,19
22
22
23 \snippet ../examples/barchart/main.cpp 3
23 \snippet ../examples/barchart/main.cpp 3
24
24
25 We want our barchart to behave so, that when mouse is hovered over bar, the name of set which the bar
25 Then we create a chart and add the series to it.
26 represents is shown as tooltip.
27 Also when we click the bar, floating values for the set are toggled. Floating values are the data values
28 that are drawn on top of bars.
29
26
30 \snippet ../examples/barchart/main.cpp 4
27 \snippet ../examples/barchart/main.cpp 4
31
28
32 Here we create the view and add our series to it. Also we set the title and theme we want our chart to use
29 And we also want to show the legend, so that the data is easier to read.
33
30
34 \snippet ../examples/barchart/main.cpp 5
31 \snippet ../examples/barchart/main.cpp 5
35
32
36 For barchart, we don't need X-axis to be visible, so it can be disabled.
33 Finally we add the chart onto a view.
37
34
38 \snippet ../examples/barchart/main.cpp 6
35 \snippet ../examples/barchart/main.cpp 6
36
37 And it is ready to be shown in a window.
38
39 \snippet ../examples/percentbarchart/main.cpp 7
39 */
40 */
@@ -3,37 +3,15
3 \title PercentBarChart Example
3 \title PercentBarChart Example
4 \subtitle
4 \subtitle
5
5
6 The example shows how to create simple percent bar chart. Percent bar chart shows the data in set as percentage of all sets, per category.
6 The example shows how to create simple percent bar chart. Percent bar chart shows the data in set as percentage of
7 all sets, per category.
7
8
8 \image percentbarchart.png
9 \image examples_percentbarchart.png
9
10
10 First we define categories.
11 Creating percent bar chart is just like creating a regular \l {BarChart Example} {bar chart}, except that for a
11
12 percent bar chart, we use QPercentBarSeries api instead of QBarSeries. Also, in the
12 \snippet ../examples/percentbarchart/main.cpp 1
13 \l {BarChart Example} {bar chart} we used nice numbers algorithm to make the y axis numbering look better. With
13
14 percent bar chart there is no need for that, because the maximum y-axis value is always 100.
14 Data that barchart visualizes, is defined by QBarSet instances. Here we create some sets and append data
15 we want to visulaize to them.
16
17 \snippet ../examples/percentbarchart/main.cpp 2
18
19 To combine the sets and categories to a chart, we need to create QBarSeries instance. When creating
20 the QBarSeries, the categories must be known. Sets can be added later. For example purposes the sets
21 are added to series here.
22
15
23 \snippet ../examples/percentbarchart/main.cpp 3
16 \snippet ../examples/percentbarchart/main.cpp 3
24
25 We want our barchart to behave so, that when mouse is hovered over bar, the name of set which the bar
26 represents is shown as tooltip.
27 Also when we click the bar, floating values for the set are toggled. Floating values are the data values
28 that are drawn on top of bars.
29
30 \snippet ../examples/percentbarchart/main.cpp 4
31
32 Here we create the view and add our series to it. Also we set the title and theme we want our chart to use
33
34 \snippet ../examples/percentbarchart/main.cpp 5
35
36 For barchart, we don't need X-axis to be visible, so it can be disabled.
37
38 \snippet ../examples/percentbarchart/main.cpp 6
39 */
17 */
@@ -3,37 +3,13
3 \title StackedBarChart Example
3 \title StackedBarChart Example
4 \subtitle
4 \subtitle
5
5
6 The example shows how to create simple stacked bar chart. Stacked bar chart shows the data in sets as bars that are stacked on top of each other. The stacking is done per category.
6 The example shows how to create simple stacked bar chart. Stacked bar chart shows the data in sets as bars that are
7 stacked on top of each other. The stacking is done per category.
7
8
8 \image stackedbarchart.png
9 \image examples_stackedbarchart.png
9
10
10 First we define categories.
11 Creating stacked bar chart is just like creating a regular \l {BarChart Example} {bar chart}, except that for a
11
12 stacked bar chart, we use QStackedBarSeries api instead of QBarSeries.
12 \snippet ../examples/stackedbarchart/main.cpp 1
13
14 Data that barchart visualizes, is defined by QBarSet instances. Here we create some sets and append data
15 we want to visulaize to them.
16
17 \snippet ../examples/stackedbarchart/main.cpp 2
18
19 To combine the sets and categories to a chart, we need to create QBarSeries instance. When creating
20 the QBarSeries, the categories must be known. Sets can be added later. For example purposes the sets
21 are added to series here.
22
13
23 \snippet ../examples/stackedbarchart/main.cpp 3
14 \snippet ../examples/stackedbarchart/main.cpp 3
24
25 We want our barchart to behave so, that when mouse is hovered over bar, the name of set which the bar
26 represents is shown as tooltip.
27 Also when we click the bar, floating values for the set are toggled. Floating values are the data values
28 that are drawn on top of bars.
29
30 \snippet ../examples/stackedbarchart/main.cpp 4
31
32 Here we create the view and add our series to it. Also we set the title and theme we want our chart to use
33
34 \snippet ../examples/stackedbarchart/main.cpp 5
35
36 For barchart, we don't need X-axis to be visible, so it can be disabled.
37
38 \snippet ../examples/stackedbarchart/main.cpp 6
39 */
15 */
@@ -4,8 +4,8
4 \subtitle
4 \subtitle
5
5
6 The example shows how to create your own custom zooming effect with QRubberBand.
6 The example shows how to create your own custom zooming effect with QRubberBand.
7 \image example_zoomlinechart1.png
7 \image examples_zoomlinechart1.png
8 \image example_zoomlinechart2.png
8 \image examples_zoomlinechart2.png
9
9
10 Let's first create a line series with some example data.
10 Let's first create a line series with some example data.
11 \snippet ../examples/zoomlinechart/main.cpp 1
11 \snippet ../examples/zoomlinechart/main.cpp 1
@@ -62,7 +62,7 int main(int argc, char *argv[])
62 //![4]
62 //![4]
63 QChart* chart = new QChart();
63 QChart* chart = new QChart();
64 chart->addSeries(series);
64 chart->addSeries(series);
65 chart->setTitle("Simple precentbarchart example");
65 chart->setTitle("Simple percentbarchart example");
66 //![4]
66 //![4]
67
67
68 //![5]
68 //![5]
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
General Comments 0
You need to be logged in to leave comments. Login now