##// END OF EJS Templates
Fixes header guard style issues
Fixes header guard style issues

File last commit:

r574:5a19c3a8f92b
r969:db6eae90aaea
Show More
examples-presenterchart.qdoc
47 lines | 2.3 KiB | text/plain | TextLexer
/ doc / src / examples-presenterchart.qdoc
Michal Klocek
Adds chartPresenter example to docs
r482 /*!
Tero Ahola
Fixing example documentation
r500 \example examples/presenterchart
Michal Klocek
Adds chartPresenter example to docs
r482 \title PresenterChart Example
\subtitle
Michal Klocek
Updates presenter example documentation
r574 The example shows how to create chart which presents the same set of data as line, scatter, spline and area charts.
ChartPresenter will switch between these four chart types every few seconds.
Michal Klocek
Adds chartPresenter example to docs
r482 Please note this example does not use common data model. A use of common data model is documented here.[TODO]
\image presenterchart1.png
\image presenterchart2.png
\image presenterchart3.png
Michal Klocek
Updates presenter example documentation
r574 \image presenterchart4.png
Michal Klocek
Adds chartPresenter example to docs
r482
We create simple ChartView class which derives form QChartView.
sauimone
fixed example paths in doc
r496 \snippet ../examples/presenterchart/chartview.h 1
Michal Klocek
Adds chartPresenter example to docs
r482
Class will implement \c handleTimeout() slot which we are going to use to trigger switching between different chart presentations.
Michal Klocek
Updates presenter example documentation
r574 We are also going to provide \c handlePoitClicked() slot which will show clicked point on the chart.
Michal Klocek
Adds chartPresenter example to docs
r482 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
Michal Klocek
Updates presenter example documentation
r574 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.
Michal Klocek
Adds chartPresenter example to docs
r482 We set custom line and points colors.
sauimone
fixed example paths in doc
r496 \snippet ../examples/presenterchart/chartview.cpp 1
Michal Klocek
Adds chartPresenter example to docs
r482
Michal Klocek
Updates presenter example documentation
r574 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,
it is wiser to use shared data model, as described here.[TODO]
Michal Klocek
Adds chartPresenter example to docs
r482
sauimone
fixed example paths in doc
r496 \snippet ../examples/presenterchart/chartview.cpp 2
Michal Klocek
Adds chartPresenter example to docs
r482
In the end we store references all the created series and matching titles.
sauimone
fixed example paths in doc
r496 \snippet ../examples/presenterchart/chartview.cpp 3
Michal Klocek
Adds chartPresenter example to docs
r482
Michal Klocek
Updates presenter example documentation
r574 We connect \c clicked() signals from each series with our \c handlePointClciked() slot.
Michal Klocek
Adds chartPresenter example to docs
r482
sauimone
fixed example paths in doc
r496 \snippet ../examples/presenterchart/chartview.cpp 4
Michal Klocek
Adds chartPresenter example to docs
r482
Michal Klocek
Updates presenter example documentation
r574 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.
\snippet ../examples/presenterchart/chartview.cpp 5
In \c handlePointClciked() slot we set the chart's title to show clicked point x and y coordinates.
\snippet ../examples/presenterchart/chartview.cpp 6
Michal Klocek
Adds chartPresenter example to docs
r482 */