|
1 | NO CONTENT: new file 100644, binary diff hidden |
@@ -0,0 +1,46 | |||
|
1 | /*! | |
|
2 | \example examples/lineandbar | |
|
3 | \title Line and BarChart Example | |
|
4 | \subtitle | |
|
5 | ||
|
6 | The example shows how to combine different charts and set the axes. In the example we combine linechart with | |
|
7 | barchart and use category axis as common axis for both. | |
|
8 | ||
|
9 | \image examples_lineandbar.png | |
|
10 | ||
|
11 | Here we create data for our barseries. | |
|
12 | ||
|
13 | \snippet ../examples/lineandbar/main.cpp 1 | |
|
14 | ||
|
15 | We create the barseries and append the sets to it. | |
|
16 | First value of each set are gropuped together at first category second value to second category and so on. | |
|
17 | ||
|
18 | \snippet ../examples/lineandbar/main.cpp 2 | |
|
19 | ||
|
20 | Then we create lineseries and add data to it. To make data match with barchart we use index as an x-value for our line series, so that | |
|
21 | first point is at (0,value) second at (1,value) and so on. | |
|
22 | ||
|
23 | \snippet ../examples/lineandbar/main.cpp 8 | |
|
24 | ||
|
25 | Here we create the chart and add both series to it. | |
|
26 | ||
|
27 | \snippet ../examples/lineandbar/main.cpp 3 | |
|
28 | ||
|
29 | To make chart show series properly, we have to create custom axes for series. If we don't create custom axes, then each series will get scaled to | |
|
30 | use maximum area of the chart (like in single series case) and result will be incorrect. With custom axes we set the range of both series to follow same | |
|
31 | axis. For x-axis we use QBarCategoryAxis and for y-axis we use QValuesAxis. | |
|
32 | ||
|
33 | \snippet ../examples/lineandbar/main.cpp 4 | |
|
34 | ||
|
35 | And we also want to show the legend. | |
|
36 | ||
|
37 | \snippet ../examples/lineandbar/main.cpp 5 | |
|
38 | ||
|
39 | Finally we add the chart onto a view. | |
|
40 | ||
|
41 | \snippet ../examples/lineandbar/main.cpp 6 | |
|
42 | ||
|
43 | And it is ready to be shown in a window. | |
|
44 | ||
|
45 | \snippet ../examples/lineandbar/main.cpp 7 | |
|
46 | */ |
@@ -1,38 +1,39 | |||
|
1 | 1 | /*! |
|
2 | 2 | \page examples.html |
|
3 | 3 | \title Examples |
|
4 | 4 | \keyword Examples |
|
5 | 5 | |
|
6 | 6 | \raw HTML |
|
7 | 7 | <table cellpadding="2" cellspacing="1" border="0" width="100%" class="indextable"> |
|
8 | 8 | <tr> |
|
9 | 9 | <th class="titleheader" width="33%"> |
|
10 | 10 | List of examples |
|
11 | 11 | </th> |
|
12 | 12 | </tr> |
|
13 | 13 | <tr> |
|
14 | 14 | <td valign="top"> |
|
15 | 15 | <ul> |
|
16 | 16 | <li><a href="examples-areachart.html">Area chart</a></li> |
|
17 | 17 | <li><a href="examples-barchart.html">Bar chart</a></li> |
|
18 | 18 | <li><a href="examples-customchart.html">Custom chart</a></li> |
|
19 | 19 | <li><a href="examples-legend.html">Legend</a></li> |
|
20 | 20 | <li><a href="examples-linechart.html">Line chart</a></li> |
|
21 | <li><a href="examples-lineandbar.html">Line and barchart</a></li> | |
|
21 | 22 | <li><a href="examples-modeldata.html">Model data</a></li> |
|
22 | 23 | <li><a href="examples-barmodelmapper.html">Bar chart from model</a></li> |
|
23 | 24 | <li><a href="examples-percentbarchart.html">Percent bar chart</a></li> |
|
24 | 25 | <li><a href="examples-piechart.html">Pie chart</a></li> |
|
25 | 26 | <li><a href="examples-piechartdrilldown.html">Pie chart drilldown</a></li> |
|
26 | 27 | <li><a href="examples-presenterchart.html">Presenter chart</a></li> |
|
27 | 28 | <li><a href="examples-scatterchart.html">Scatter chart</a></li> |
|
28 | 29 | <li><a href="examples-scatterinteractions.html">Scatter interactions</a></li> |
|
29 | 30 | <li><a href="examples-splinechart.html">Spline chart</a></li> |
|
30 | 31 | <li><a href="examples-stackedbarchart.html">Stacked bar chart</a></li> |
|
31 | 32 | <li><a href="examples-stackedbarchartdrilldown.html">Stacked bar chart drilldown</a></li> |
|
32 | 33 | <li><a href="examples-zoomlinechart.html">Zoom line</a></li> |
|
33 | 34 | </ul> |
|
34 | 35 | </td> |
|
35 | 36 | </tr> |
|
36 | 37 | </table> |
|
37 | 38 | \endraw |
|
38 | 39 | */ |
General Comments 0
You need to be logged in to leave comments.
Login now