##// END OF EJS Templates
Example on main qdoc page.
Tero Ahola -
r334:d6ea428dc600
parent child
Show More
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -6,7 +6,37
6 \raw HTML
6 \raw HTML
7 <div class="qchart">
7 <div class="qchart">
8 <img src="images/qt_commercial_logo.png" alt="qtcommercial"/>
8 <img src="images/qt_commercial_logo.png" alt="qtcommercial"/>
9 <p>QCharts is a part of Qt Commercial addons package.</p>
9 <p>QCharts is a part of Qt Commercial addons package. TODO: Introduction... With QCharts you can easily create impressive graphs of your data in Qt and QtQuick applications...</p>
10 </div>
10 </div>
11 \endraw
11 \endraw
12
13 For example, to create a chart with line series using a widget based application (TODO: decent screen shots):
14
15 \snippet ../example/chartview/main.cpp 1
16 \image chartview_example.jpg
17
18 \raw HTML
19 <table cellpadding="2" cellspacing="1" border="0" width="100%" class="indextable">
20 <tr>
21 <th class="titleheader" width="33%">
22 List of classes
23 </th>
24 </tr>
25 <tr>
26 <td valign="top">
27 <ul>
28 <li><a href="qchart.html">QChart</a></li>
29 <li><a href="qchartview.html">QChartView</a></li>
30 <li><a href="qchartseries.html">QChartSeries</a></li>
31 <li><a href="qlinechartseries.html">QLineChartSeries</a></li>
32 <li><a href="qpieseries.html">QPieSeries</a></li>
33 <li><a href="qbarchartseries.html">QBarChartSeries</a></li>
34 <li><a href="qstackedbarchartseries.html">QStackedBarChartSeries</a></li>
35 <li><a href="qpercentbarchartseries.html">QPercentBarChartSeries</a></li>
36 <li><a href="qscatterseries.html">QScatterSeries</a></li>
37 </ul>
38 </td>
39 </tr>
40 </table>
41 \endraw
12 */
42 */
@@ -3,22 +3,24
3 \title Tutorials
3 \title Tutorials
4 \keyword Tutorials
4 \keyword Tutorials
5
5
6 QtCommercial Charts introduction...
7 For example, to create a chart with line series using a widget based application:
6 For example, to create a chart with line series using a widget based application:
8 \snippet ../example/chartview/main.cpp 1
7 \snippet ../example/chartview/main.cpp 1
9 \image chartview_example.jpg
8 \image chartview_example.jpg
10
9
11 Showing a few more series:
10 To replace the line series with a pie series you use the dedicated QPieSeries class:
12 \snippet ../example/chartview/main.cpp 3
11 \snippet ../example/chartview/main.cpp 3
13 \image chartview_example_pie.jpg
12 \image chartview_example_pie.jpg
13
14 To use a scatter series you use QScatterSeries class:
14 \snippet ../example/chartview/main.cpp 4
15 \snippet ../example/chartview/main.cpp 4
15 \image chartview_example_scatter.jpg
16 \image chartview_example_scatter.jpg
17
18 And to show a bar series you use one of the bar series classes, for example QBarChartSeries:
16 \snippet ../example/chartview/main.cpp 5
19 \snippet ../example/chartview/main.cpp 5
17 \image chartview_example_bar.jpg
20 \image chartview_example_bar.jpg
18
21
19 If you need to give a more professional touch to your chart you can switch to one of the
22 If you need to give a more professional touch to your chart you can switch from the default
20 pre-defined themes:
23 theme to one of the other themes:
21 \snippet ../example/chartview/main.cpp 2
24 \snippet ../example/chartview/main.cpp 2
22 \image chartview_example_theme.jpg
25 \image chartview_example_theme.jpg
23
24 */
26 */
@@ -18,6 +18,7 int main(int argc, char *argv[])
18 //! [1]
18 //! [1]
19 // Create chart view
19 // Create chart view
20 QChartView *chartView = new QChartView();
20 QChartView *chartView = new QChartView();
21 chartView->setRenderHint(QPainter::Antialiasing);
21 // Add series to the chart
22 // Add series to the chart
22 QLineChartSeries *line = new QLineChartSeries();
23 QLineChartSeries *line = new QLineChartSeries();
23 line->add(0.0, 0.8);
24 line->add(0.0, 0.8);
@@ -33,6 +34,7 int main(int argc, char *argv[])
33
34
34 //! [3]
35 //! [3]
35 // Add pie series
36 // Add pie series
37 // ...
36 QPieSeries *pie = new QPieSeries();
38 QPieSeries *pie = new QPieSeries();
37 pie->add(3.4, "slice1");
39 pie->add(3.4, "slice1");
38 pie->add(6.7, "slice2");
40 pie->add(6.7, "slice2");
@@ -41,6 +43,7 int main(int argc, char *argv[])
41
43
42 //! [4]
44 //! [4]
43 // Add scatter series
45 // Add scatter series
46 // ...
44 QScatterSeries *scatter = new QScatterSeries();
47 QScatterSeries *scatter = new QScatterSeries();
45 for (qreal x(0); x < 100; x += 0.5) {
48 for (qreal x(0); x < 100; x += 0.5) {
46 qreal y = rand() % 100;
49 qreal y = rand() % 100;
@@ -50,6 +53,7 int main(int argc, char *argv[])
50 //! [4]
53 //! [4]
51
54
52 //! [5]
55 //! [5]
56 // ...
53 // Add bar series
57 // Add bar series
54 QBarCategory *barCategory = new QBarCategory();
58 QBarCategory *barCategory = new QBarCategory();
55 *barCategory << "Jan"
59 *barCategory << "Jan"
@@ -65,7 +69,7 int main(int argc, char *argv[])
65 //! [5]
69 //! [5]
66
70
67 QMainWindow w;
71 QMainWindow w;
68 w.resize(350, 250);
72 w.resize(380, 250);
69 w.setCentralWidget(chartView);
73 w.setCentralWidget(chartView);
70 w.show();
74 w.show();
71
75
@@ -27,23 +27,6
27 QChartSeries and other chart related objects like QChartAxis and QChartLegend. If you want to
27 QChartSeries and other chart related objects like QChartAxis and QChartLegend. If you want to
28 display a chart in your existing QGraphicsScene, you can use the QChart class instead.
28 display a chart in your existing QGraphicsScene, you can use the QChart class instead.
29
29
30 For example, to create a chart with line series using a widget based application:
31 \snippet ../example/chartview/main.cpp 1
32 \image chartview_example.jpg
33
34 Showing a few more series:
35 \snippet ../example/chartview/main.cpp 3
36 \image chartview_example_pie.jpg
37 \snippet ../example/chartview/main.cpp 4
38 \image chartview_example_scatter.jpg
39 \snippet ../example/chartview/main.cpp 5
40 \image chartview_example_bar.jpg
41
42 If you need to give a more professional touch to your chart you can switch to one of the
43 pre-defined themes:
44 \snippet ../example/chartview/main.cpp 2
45 \image chartview_example_theme.jpg
46
47 \sa QChart
30 \sa QChart
48 */
31 */
49
32
General Comments 0
You need to be logged in to leave comments. Login now