@@ -1,86 +1,87 | |||||
1 | /*! |
|
1 | /*! | |
2 | \page classes.html |
|
2 | \page classes.html | |
3 | \title QtCommercial Charts API |
|
3 | \title QtCommercial Charts API | |
4 | \keyword All Classes |
|
4 | \keyword All Classes | |
5 |
|
5 | |||
6 | Charts API is build on top of Qt Graphics View Framework. Charts can be displayed as QGraphicsWidget using QChart class. However |
|
6 | Charts API is build on top of Qt Graphics View Framework. Charts can be displayed as QGraphicsWidget using QChart class. However | |
7 | there is also convenience class QChartView which is QWidget based. These lets quickly use QCharts as normal Qt widget. |
|
7 | there is also convenience class QChartView which is QWidget based. These lets quickly use QCharts as normal Qt widget. | |
8 |
|
8 | |||
9 | Each chart type is represented by QAbstractSeries derived class. To create given chart type users have to use instance of related series class and add it to QChart instance. |
|
9 | Each chart type is represented by QAbstractSeries derived class. To create given chart type users have to use instance of related series class and add it to QChart instance. | |
10 | \code |
|
10 | \code | |
11 | QLineSeries* series = new QLineSeries(); |
|
11 | QLineSeries* series = new QLineSeries(); | |
12 | series->add(0, 6); |
|
12 | series->add(0, 6); | |
13 | series->add(2, 4); |
|
13 | series->add(2, 4); | |
14 | ... |
|
14 | ... | |
15 | chartView->chart()->addSeries(series); |
|
15 | chartView->chart()->addSeries(series); | |
|
16 | chartView->chart()->createDefaultAxes(); | |||
16 | \endcode |
|
17 | \endcode | |
17 |
|
18 | |||
18 | \raw HTML |
|
19 | \raw HTML | |
19 | <table cellpadding="2" cellspacing="1" border="0" width="100%" class="indextable"> |
|
20 | <table cellpadding="2" cellspacing="1" border="0" width="100%" class="indextable"> | |
20 | <tr> |
|
21 | <tr> | |
21 | <th class="titleheader" width="25%"> |
|
22 | <th class="titleheader" width="25%"> | |
22 | Common and global |
|
23 | Common and global | |
23 | </th> |
|
24 | </th> | |
24 | <th class="titleheader" width="25%"> |
|
25 | <th class="titleheader" width="25%"> | |
25 | XY chart |
|
26 | XY chart | |
26 | </th> |
|
27 | </th> | |
27 | </tr> |
|
28 | </tr> | |
28 | <tr> |
|
29 | <tr> | |
29 | <td valign="top"> |
|
30 | <td valign="top"> | |
30 | <ul> |
|
31 | <ul> | |
31 | <li><a href="qchart.html">QChart</a></li> |
|
32 | <li><a href="qchart.html">QChart</a></li> | |
|
33 | <li><a href="qchartview.html">QChartView</a></li> | |||
32 | <li><a href="qabstractaxis.html">QAbstractAxis</a></li> |
|
34 | <li><a href="qabstractaxis.html">QAbstractAxis</a></li> | |
33 | <li><a href="qvaluesaxis.html">QValuesAxis</a></li> |
|
35 | <li><a href="qvaluesaxis.html">QValuesAxis</a></li> | |
34 | <li><a href="qbarcategoriesaxis.html">QBarCategoriesAxis</a></li> |
|
36 | <li><a href="qbarcategoriesaxis.html">QBarCategoriesAxis</a></li> | |
35 | <li><a href="qintervalaxis.html">QIntervalAxis</a></li> |
|
37 | <li><a href="qintervalaxis.html">QIntervalAxis</a></li> | |
36 | <li><a href="qchartview.html">QChartView</a></li> |
|
|||
37 | <li><a href="qlegend.html">QLegend</a></li> |
|
38 | <li><a href="qlegend.html">QLegend</a></li> | |
38 | <li><a href="qabstractseries.html">QAbstractSeries</a></li> |
|
39 | <li><a href="qabstractseries.html">QAbstractSeries</a></li> | |
39 | <li><a href="qchartglobal.html">QChartGlobal</a></li> |
|
40 | <li><a href="qchartglobal.html">QChartGlobal</a></li> | |
40 | </ul> |
|
41 | </ul> | |
41 | </td> |
|
42 | </td> | |
42 | <td valign="top"> |
|
43 | <td valign="top"> | |
43 | <ul> |
|
44 | <ul> | |
44 | <li><a href="qxyseries.html">QXYSeries</a></li> |
|
45 | <li><a href="qxyseries.html">QXYSeries</a></li> | |
45 | <li><a href="qlineseries.html">QLineSeries</a></li> |
|
46 | <li><a href="qlineseries.html">QLineSeries</a></li> | |
46 | <li><a href="qareaseries.html">QAreaSeries</a></li> |
|
47 | <li><a href="qareaseries.html">QAreaSeries</a></li> | |
47 | <li><a href="qscatterseries.html">QScatterSeries</a></li> |
|
48 | <li><a href="qscatterseries.html">QScatterSeries</a></li> | |
48 | <li><a href="qsplineseries.html">QSplineSeries</a></li> |
|
49 | <li><a href="qsplineseries.html">QSplineSeries</a></li> | |
49 | <li><a href="qhxymodelmapper.html">QHXYModelMapper</a></li> |
|
50 | <li><a href="qhxymodelmapper.html">QHXYModelMapper</a></li> | |
50 | <li><a href="qvxymodelmapper.html">QVXYModelMapper</a></li> |
|
51 | <li><a href="qvxymodelmapper.html">QVXYModelMapper</a></li> | |
51 | </ul> |
|
52 | </ul> | |
52 | </td> |
|
53 | </td> | |
53 | </tr> |
|
54 | </tr> | |
54 | </table> |
|
55 | </table> | |
55 | <table cellpadding="2" cellspacing="1" border="0" width="100%" class="indextable"> |
|
56 | <table cellpadding="2" cellspacing="1" border="0" width="100%" class="indextable"> | |
56 | <tr> |
|
57 | <tr> | |
57 | <th class="titleheader" width="25%"> |
|
58 | <th class="titleheader" width="25%"> | |
58 | Pie chart |
|
59 | Pie chart | |
59 | </th> |
|
60 | </th> | |
60 | <th class="titleheader" width="25%"> |
|
61 | <th class="titleheader" width="25%"> | |
61 | Bar chart |
|
62 | Bar chart | |
62 | </th> |
|
63 | </th> | |
63 | <tr> |
|
64 | <tr> | |
64 | <td valign="top"> |
|
65 | <td valign="top"> | |
65 | <ul> |
|
66 | <ul> | |
66 | <li><a href="qpieseries.html">QPieSeries</a></li> |
|
67 | <li><a href="qpieseries.html">QPieSeries</a></li> | |
67 | <li><a href="qpieslice.html">QPieSlice</a></li> |
|
68 | <li><a href="qpieslice.html">QPieSlice</a></li> | |
68 | <li><a href="qhpiemodelmapper.html">QHPieModelMapper</a></li> |
|
69 | <li><a href="qhpiemodelmapper.html">QHPieModelMapper</a></li> | |
69 | <li><a href="qvpiemodelmapper.html">QVPieModelMapper</a></li> |
|
70 | <li><a href="qvpiemodelmapper.html">QVPieModelMapper</a></li> | |
70 | </ul> |
|
71 | </ul> | |
71 | </td> |
|
72 | </td> | |
72 | <td valign="top"> |
|
73 | <td valign="top"> | |
73 | <ul> |
|
74 | <ul> | |
74 | <li><a href="qbarseries.html">QBarSeries</a></li> |
|
75 | <li><a href="qbarseries.html">QBarSeries</a></li> | |
75 | <li><a href="qbarset.html">QBarSet</a></li> |
|
76 | <li><a href="qbarset.html">QBarSet</a></li> | |
76 | <li><a href="qpercentbarseries.html">QPercentBarSeries</a></li> |
|
77 | <li><a href="qpercentbarseries.html">QPercentBarSeries</a></li> | |
77 | <li><a href="qstackedbarseries.html">QStackedBarSeries</a></li> |
|
78 | <li><a href="qstackedbarseries.html">QStackedBarSeries</a></li> | |
78 | <li><a href="qhbarmodelmapper.html">QHBarModelMapper</a></li> |
|
79 | <li><a href="qhbarmodelmapper.html">QHBarModelMapper</a></li> | |
79 | <li><a href="qvbarmodelmapper.html">QVBarModelMapper</a></li> |
|
80 | <li><a href="qvbarmodelmapper.html">QVBarModelMapper</a></li> | |
80 | </ul> |
|
81 | </ul> | |
81 | </td> |
|
82 | </td> | |
82 | </tr> |
|
83 | </tr> | |
83 | </table> |
|
84 | </table> | |
84 | \endraw |
|
85 | \endraw | |
85 |
|
86 | |||
86 | */ |
|
87 | */ |
@@ -1,30 +1,30 | |||||
1 | /*! |
|
1 | /*! | |
2 | \example examples/areachart |
|
2 | \example examples/areachart | |
3 | \title AreaChart Example |
|
3 | \title AreaChart Example | |
4 | \subtitle |
|
4 | \subtitle | |
5 |
|
5 | |||
6 | The example shows how to create simple area chart. |
|
6 | The example shows how to create simple area chart. | |
7 |
|
7 | |||
8 | \image examples_areachart.png |
|
8 | \image examples_areachart.png | |
9 |
|
9 | |||
10 | To create area charts, we need two QLineSeries instances. They are going to define upper and lower boundary of the area. |
|
10 | To create area charts, we need two QLineSeries instances. They are going to define upper and lower boundary of the area. | |
11 |
|
11 | |||
12 | \snippet ../examples/areachart/main.cpp 1 |
|
12 | \snippet ../examples/areachart/main.cpp 1 | |
13 |
|
13 | |||
14 | We add data to both series, we use stream operator. |
|
14 | We add data to both series, we use stream operator. | |
15 |
|
15 | |||
16 | \snippet ../examples/areachart/main.cpp 2 |
|
16 | \snippet ../examples/areachart/main.cpp 2 | |
17 |
|
17 | |||
18 | Now we create QAreaSeries instance using two line series objects. We set the custom gradient fill and width of the outline. |
|
18 | Now we create QAreaSeries instance using two line series objects. We set the custom gradient fill and width of the outline. | |
19 |
|
19 | |||
20 | \snippet ../examples/areachart/main.cpp 3 |
|
20 | \snippet ../examples/areachart/main.cpp 3 | |
21 |
|
21 | |||
22 |
In the end we create QChartView instance, set title, set anti-aliasing and add area series. We also |
|
22 | In the end we create QChartView instance, set title, set anti-aliasing and add area series. We also create the default axes and specify the ranges on them. | |
23 |
|
23 | |||
24 | \snippet ../examples/areachart/main.cpp 4 |
|
24 | \snippet ../examples/areachart/main.cpp 4 | |
25 |
|
25 | |||
26 | Chart is ready to be shown. |
|
26 | Chart is ready to be shown. | |
27 |
|
27 | |||
28 | \snippet ../examples/areachart/main.cpp 5 |
|
28 | \snippet ../examples/areachart/main.cpp 5 | |
29 |
|
29 | |||
30 | */ |
|
30 | */ |
@@ -1,30 +1,30 | |||||
1 | /*! |
|
1 | /*! | |
2 | \example examples/linechart |
|
2 | \example examples/linechart | |
3 | \title LineChart Example |
|
3 | \title LineChart Example | |
4 | \subtitle |
|
4 | \subtitle | |
5 |
|
5 | |||
6 | The example shows how to create simple line chart. |
|
6 | The example shows how to create simple line chart. | |
7 |
|
7 | |||
8 | \image examples_linechart.png |
|
8 | \image examples_linechart.png | |
9 |
|
9 | |||
10 | To create line chart, QLineSeries instance is needed. Let's create one. |
|
10 | To create line chart, QLineSeries instance is needed. Let's create one. | |
11 |
|
11 | |||
12 | \snippet ../examples/linechart/main.cpp 1 |
|
12 | \snippet ../examples/linechart/main.cpp 1 | |
13 |
|
13 | |||
14 | Then we add data to series. We can use add() member function or use stream operator. |
|
14 | Then we add data to series. We can use add() member function or use stream operator. | |
15 |
|
15 | |||
16 | \snippet ../examples/linechart/main.cpp 2 |
|
16 | \snippet ../examples/linechart/main.cpp 2 | |
17 |
|
17 | |||
18 | To present the data on the char we need QChart instance. We add the series to it and set the title of the chart. |
|
18 | To present the data on the char we need QChart instance. We add the series to it, create the default axes and set the title of the chart. | |
19 |
|
19 | |||
20 | \snippet ../examples/linechart/main.cpp 3 |
|
20 | \snippet ../examples/linechart/main.cpp 3 | |
21 |
|
21 | |||
22 | Then we create a QChartView object with QChart as a parameter. This way we don't need to create QGraphicsView scene ourselves. We also set the Antialiasing on to have the rendered lines look nicer. |
|
22 | Then we create a QChartView object with QChart as a parameter. This way we don't need to create QGraphicsView scene ourselves. We also set the Antialiasing on to have the rendered lines look nicer. | |
23 |
|
23 | |||
24 | \snippet ../examples/linechart/main.cpp 4 |
|
24 | \snippet ../examples/linechart/main.cpp 4 | |
25 |
|
25 | |||
26 | Chart is ready to be shown. |
|
26 | Chart is ready to be shown. | |
27 |
|
27 | |||
28 | \snippet ../examples/linechart/main.cpp 5 |
|
28 | \snippet ../examples/linechart/main.cpp 5 | |
29 |
|
29 | |||
30 | */ |
|
30 | */ |
General Comments 0
You need to be logged in to leave comments.
Login now