##// END OF EJS Templates
Updated presenter example screen shots
Tero Ahola -
r983:4dfea05bdd57
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: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -1,14 +1,12
1 /*!
1 /*!
2 \example demos/chartthemes
2 \example demos/chartthemes
3 \title Chart themes demo
3 \title Chart themes demo
4 \subtitle
4 \subtitle
5
5
6 \image demo_chartthemes_small.png
7
8 This demo shows the look and feel of the different built in themes for all supported chart types.
6 This demo shows the look and feel of the different built in themes for all supported chart types.
9 The background palette of the application is also customized according to the selected theme, to make the result
7 The background palette of the application is also customized according to the selected theme, to make the result
10 look harmonious.
8 look harmonious.
11 \image demo_chartthemes_light.png
9 \image demo_chartthemes_light.png
12 \image demo_chartthemes_brown_sand.png
10 \image demo_chartthemes_brown_sand.png
13 \image demo_chartthemes_blue_cerulean.png
11 \image demo_chartthemes_blue_cerulean.png
14 */
12 */
@@ -1,48 +1,48
1 /*!
1 /*!
2 \example examples/presenterchart
2 \example examples/presenterchart
3 \title PresenterChart Example
3 \title PresenterChart Example
4 \subtitle
4 \subtitle
5
5
6 The example shows how to create chart which presents the same set of data as line, scatter, spline and area charts.
6 The example shows how to create chart which presents the same set of data as line, scatter, spline and area charts.
7 ChartPresenter will switch between these four chart types every few seconds.
7 ChartPresenter will switch between these four chart types every few seconds. Note: You can also use the
8 Please note this example does not use common data model. A use of common data model is documented here.[TODO]
8 QAbstractItemModel related APIs to pass data for the different series types. See the \l {Model data example} for
9 more details.
9
10
10 \image presenterchart1.png
11 \image examples_presenterchart1.png
11 \image presenterchart2.png
12 \image examples_presenterchart2.png
12 \image presenterchart3.png
13 \image examples_presenterchart3.png
13 \image presenterchart4.png
14 \image examples_presenterchart4.png
14
15
15 We create simple ChartView class which derives form QChartView.
16 We create simple ChartView class which derives form QChartView.
16
17
17 \snippet ../examples/presenterchart/chartview.h 1
18 \snippet ../examples/presenterchart/chartview.h 1
18
19
19 Class will implement \c handleTimeout() slot which we are going to use to trigger switching between different chart presentations.
20 Class will implement \c handleTimeout() slot which we are going to use to trigger switching between different chart presentations.
20 We are also going to provide \c handlePoitClicked() slot which will show clicked point on the chart.
21 We are also going to provide \c handlePoitClicked() slot which will show clicked point on the chart.
21 Class members \c m_series and \c m_titles are going to store series and related titles. In example we are going to present data as a line chart
22 Class members \c m_series and \c m_titles are going to store series and related titles. In example we are going to present data as a line chart
22 using QLineSeries , as scatter chart using QScatterSeries, as a spline chart using QSplineSeries and a area chart using QAreaSeries. We create needed instances in constructor of ChartView class.
23 using QLineSeries , as scatter chart using QScatterSeries, as a spline chart using QSplineSeries and a area chart using QAreaSeries. We create needed instances in constructor of ChartView class.
23 We set custom line and points colors.
24 We set custom line and points colors.
24
25
25 \snippet ../examples/presenterchart/chartview.cpp 1
26 \snippet ../examples/presenterchart/chartview.cpp 1
26
27
27 We add data to three series. Please note area chart is going to use QLineSeries as the upper line. We can use add() member function. If data set is large,
28 We add data to three series. Please note area chart is going to use QLineSeries as the upper line. We can use add() member function.
28 it is wiser to use shared data model, as described here.[TODO]
29
29
30 \snippet ../examples/presenterchart/chartview.cpp 2
30 \snippet ../examples/presenterchart/chartview.cpp 2
31
31
32 In the end we store references all the created series and matching titles.
32 In the end we store references all the created series and matching titles.
33
33
34 \snippet ../examples/presenterchart/chartview.cpp 3
34 \snippet ../examples/presenterchart/chartview.cpp 3
35
35
36 We connect \c clicked() signals from each series with our \c handlePointClciked() slot.
36 We connect \c clicked() signals from each series with our \c handlePointClciked() slot.
37
37
38 \snippet ../examples/presenterchart/chartview.cpp 4
38 \snippet ../examples/presenterchart/chartview.cpp 4
39
39
40 In \c handleTimeout() slot we change currently displayed chart by removing previous series and adding next series from the \c m_series list. We also set proper title.
40 In \c handleTimeout() slot we change currently displayed chart by removing previous series and adding next series from the \c m_series list. We also set proper title.
41
41
42 \snippet ../examples/presenterchart/chartview.cpp 5
42 \snippet ../examples/presenterchart/chartview.cpp 5
43
43
44 In \c handlePointClciked() slot we set the chart's title to show clicked point x and y coordinates.
44 In \c handlePointClciked() slot we set the chart's title to show clicked point x and y coordinates.
45
45
46 \snippet ../examples/presenterchart/chartview.cpp 6
46 \snippet ../examples/presenterchart/chartview.cpp 6
47
47
48 */
48 */
@@ -1,44 +1,44
1 /*!
1 /*!
2 \page index.html
2 \page index.html
3 \keyword About
3 \keyword About
4
4
5 \raw HTML
5 \raw HTML
6 <div class="qchart">
6 <div class="qchart">
7 <img src="images/qt_commercial_logo.png" alt="qtcommercial"/>
7 <img src="images/qt_commercial_logo.png" alt="qtcommercial"/>
8
8
9 <p>
9 <p>
10 QCharts is a part of Qt Commercial addons package. It provides a set of easy to use chart
10 QCharts is a part of Qt Commercial addons package. It provides a set of easy to use chart
11 components which are available for Qt Commercial customers. It uses Qt Graphics View
11 components which are available for Qt Commercial customers. It uses Qt Graphics View
12 Framework, therefore charts can be easily integrated to modern 2D user interfaces. QCharts can
12 Framework, therefore charts can be easily integrated to modern 2D user interfaces. QCharts can
13 be used as QWidgets, QGraphicsWidget or QML elements. Users can easily create impressive
13 be used as QWidgets, QGraphicsWidget or QML elements. Users can easily create impressive
14 graphs by selecting one of the charts themes.
14 graphs by selecting one of the charts themes.
15 </p>
15 </p>
16
16
17 <table>
17 <table>
18 <tr>
18 <tr>
19 <td><a href="examples-linechart.html"><img src="images/examples_linechart.png" alt="linechart" /></a></td>
19 <td><a href="examples-linechart.html"><img src="images/examples_linechart.png" alt="linechart" /></a></td>
20 <td><a href="examples-areachart.html"><img src="images/examples_areachart.png" alt="areachart" /></a></td>
20 <td><a href="examples-areachart.html"><img src="images/examples_areachart.png" alt="areachart" /></a></td>
21 </tr>
21 </tr>
22 <tr>
22 <tr>
23 <td><a href="examples-scatterchart.html"><img src="images/examples_scatterchart.png" alt="scatterchart" /></a></td>
23 <td><a href="examples-scatterchart.html"><img src="images/examples_scatterchart.png" alt="scatterchart" /></a></td>
24 <td><a href="examples-barchart.html"><img src="images/examples_barchart.png" alt="barchart" /></a></td>
24 <td><a href="examples-barchart.html"><img src="images/examples_barchart.png" alt="barchart" /></a></td>
25 </tr>
25 </tr>
26 <tr>
26 <tr>
27 <td><a href="examples-stackedbarchart.html"><img src="images/examples_stackedbarchart.png" alt="stackedbarchart" /></a></td>
27 <td><a href="examples-stackedbarchart.html"><img src="images/examples_stackedbarchart.png" alt="stackedbarchart" /></a></td>
28 <td><a href="examples-percentbarchart.html"><img src="images/examples_percentbarchart.png" alt="percentbarcchart" /></a></td>
28 <td><a href="examples-percentbarchart.html"><img src="images/examples_percentbarchart.png" alt="percentbarcchart" /></a></td>
29 </tr>
29 </tr>
30 <tr>
30 <tr>
31 <td><a href="examples-splinechart.html"><img src="images/examples_splinechart.png" alt="linechart" /></a></td>
31 <td><a href="examples-splinechart.html"><img src="images/examples_splinechart.png" alt="linechart" /></a></td>
32 <td><a href="examples-piechart.html"><img src="images/examples_piechart.png" alt="piechart" /></a></td>
32 <td><a href="examples-piechart.html"><img src="images/examples_piechart.png" alt="piechart" /></a></td>
33 </tr>
33 </tr>
34 <tr>
34 <tr>
35 <td><a href="examples-customchart.html"><img src="images/examples_customchart.png" alt="customerchart" /></a></td>
35 <td><a href="examples-customchart.html"><img src="images/examples_customchart.png" alt="customerchart" /></a></td>
36 <td><a href="examples-zoomlinechart.html"><img src="images/examples_zoomlinechart2.png" alt="zoomlinechart" /></a></td>
36 <td><a href="examples-zoomlinechart.html"><img src="images/examples_zoomlinechart2.png" alt="zoomlinechart" /></a></td>
37 </tr>
37 </tr>
38 <tr>
38 <tr>
39 <td><a href="demos-chartthemes.html"><img src="images/demo_chartthemes_small.png" alt="charttheme" /></a></td>
39 <td><a href="demos-chartthemes.html"><img src="images/demo_chartthemes_blue_cerulean.png" width=514 alt="charttheme" /></a></td>
40 </tr>
40 </tr>
41 </table>
41 </table>
42 </div>
42 </div>
43 \endraw
43 \endraw
44 */
44 */
@@ -1,37 +1,39
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2012 Digia Plc
3 ** Copyright (C) 2012 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Commercial Charts Add-on.
7 ** This file is part of the Qt Commercial Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial License Agreement provided with the
11 ** accordance with the Qt Commercial License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 #include "chartview.h"
21 #include "chartview.h"
22 #include <QApplication>
22 #include <QApplication>
23 #include <QMainWindow>
23 #include <QMainWindow>
24
24
25 int main(int argc, char *argv[])
25 int main(int argc, char *argv[])
26 {
26 {
27 QApplication a(argc, argv);
27 QApplication a(argc, argv);
28 QMainWindow window;
28 QMainWindow window;
29 QChart* chart = new QChart();
29 QChart* chart = new QChart();
30 chart->axisX()->setNiceNumbers(true);
31 chart->axisY()->setNiceNumbers(true);
30 ChartView chartView(chart,&window);
32 ChartView chartView(chart,&window);
31 chartView.setRenderHint(QPainter::Antialiasing);
33 chartView.setRenderHint(QPainter::Antialiasing);
32 chart->setAnimationOptions(QChart::AllAnimations);
34 chart->setAnimationOptions(QChart::AllAnimations);
33 window.setCentralWidget(&chartView);
35 window.setCentralWidget(&chartView);
34 window.resize(400, 300);
36 window.resize(400, 300);
35 window.show();
37 window.show();
36 return a.exec();
38 return a.exec();
37 }
39 }
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
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