##// 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
1 NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
@@ -3,10 +3,40
3 3 \title About QCharts
4 4 \keyword About
5 5
6 \raw HTML
6 \raw HTML
7 7 <div class="qchart">
8 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 10 </div>
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>
11 41 \endraw
12 42 */
@@ -3,22 +3,24
3 3 \title Tutorials
4 4 \keyword Tutorials
5 5
6 QtCommercial Charts introduction...
7 6 For example, to create a chart with line series using a widget based application:
8 7 \snippet ../example/chartview/main.cpp 1
9 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 11 \snippet ../example/chartview/main.cpp 3
13 12 \image chartview_example_pie.jpg
13
14 To use a scatter series you use QScatterSeries class:
14 15 \snippet ../example/chartview/main.cpp 4
15 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 19 \snippet ../example/chartview/main.cpp 5
17 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
20 pre-defined themes:
22 If you need to give a more professional touch to your chart you can switch from the default
23 theme to one of the other themes:
21 24 \snippet ../example/chartview/main.cpp 2
22 25 \image chartview_example_theme.jpg
23
24 26 */
@@ -18,6 +18,7 int main(int argc, char *argv[])
18 18 //! [1]
19 19 // Create chart view
20 20 QChartView *chartView = new QChartView();
21 chartView->setRenderHint(QPainter::Antialiasing);
21 22 // Add series to the chart
22 23 QLineChartSeries *line = new QLineChartSeries();
23 24 line->add(0.0, 0.8);
@@ -33,6 +34,7 int main(int argc, char *argv[])
33 34
34 35 //! [3]
35 36 // Add pie series
37 // ...
36 38 QPieSeries *pie = new QPieSeries();
37 39 pie->add(3.4, "slice1");
38 40 pie->add(6.7, "slice2");
@@ -41,6 +43,7 int main(int argc, char *argv[])
41 43
42 44 //! [4]
43 45 // Add scatter series
46 // ...
44 47 QScatterSeries *scatter = new QScatterSeries();
45 48 for (qreal x(0); x < 100; x += 0.5) {
46 49 qreal y = rand() % 100;
@@ -50,6 +53,7 int main(int argc, char *argv[])
50 53 //! [4]
51 54
52 55 //! [5]
56 // ...
53 57 // Add bar series
54 58 QBarCategory *barCategory = new QBarCategory();
55 59 *barCategory << "Jan"
@@ -65,7 +69,7 int main(int argc, char *argv[])
65 69 //! [5]
66 70
67 71 QMainWindow w;
68 w.resize(350, 250);
72 w.resize(380, 250);
69 73 w.setCentralWidget(chartView);
70 74 w.show();
71 75
@@ -27,23 +27,6
27 27 QChartSeries and other chart related objects like QChartAxis and QChartLegend. If you want to
28 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 30 \sa QChart
48 31 */
49 32
General Comments 0
You need to be logged in to leave comments. Login now