##// END OF EJS Templates
Added missing example files
Marek Rosa -
r435:0d574f2c3ab8
parent child
Show More
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -0,0 +1,42
1 /*!
2 \example example/splinechart
3 \title SplineChart Example
4 \subtitle
5
6 The example shows how to create simple spline chart.
7
8 \image splinechart_example
9
10 To create spline chart we need to put our data into QSplineSeries. QSplineSeries automatically calculates spline segment control points that are needed to properly draw the spline.
11
12 \snippet ../example/splinechart/splinewidget.cpp 1
13
14 Customize the look of the spline, by setting its pen's color and pen's width
15
16 \snippet ../example/splinechart/splinewidget.cpp 2
17
18 Now lets add some data points to the series.
19
20 \snippet ../example/splinechart/splinewidget.cpp add points to series
21
22 The data series has been populated. To display it on a chart we create QChartView object and add the data series to it. We also set the ranges on both axises, so that our chart is fully visible and there is some excess of space for adding more data points.
23
24 \snippet ../example/splinechart/splinewidget.cpp 3
25
26 Then we add two buttons for adding and removing data points. Buttons clicked() signals are connected to handler functions.
27
28 \snippet ../example/splinechart/splinewidget.cpp 4
29
30 In the end we add the chart and the buttons to the widget's layout.
31
32 \snippet ../example/splinechart/splinewidget.cpp 5
33
34 Here is the handler function for add new data point button:
35
36 \snippet ../example/splinechart/splinewidget.cpp add point
37
38 And here is one for remove the last data point in the series:
39
40 \snippet ../example/splinechart/splinewidget.cpp remove point
41
42 */
General Comments 0
You need to be logged in to leave comments. Login now