##// END OF EJS Templates
Update line and spline chart examples
Marek Rosa -
r902:a116b3f97280
parent child
Show More
1 NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
@@ -11,10 +11,6
11 11
12 12 \snippet ../examples/splinechart/main.cpp 1
13 13
14 Customize the look of the spline, by setting its pen's color and pen's width
15
16 \snippet ../examples/splinechart/main.cpp 2
17
18 14 Now lets add some data points to the series.
19 15
20 16 \snippet ../examples/splinechart/main.cpp 3
@@ -23,7 +19,7 The data series has been populated. To display it on a chart we create QChart ob
23 19
24 20 \snippet ../examples/splinechart/main.cpp 4
25 21
26 Then we created a QChartView object with QChart as a parameter. This way we don't need to create QGraphicsView scene ourselves. We also set the Antialiasing on to have the rendered lines look nicer.
22 Then we create a QChartView object with QChart as a parameter. This way we don't need to create QGraphicsView scene ourselves. We also set the Antialiasing on to have the rendered lines look nicer.
27 23
28 24 \snippet ../examples/splinechart/main.cpp 5
29 25
@@ -7,20 +7,24
7 7
8 8 \image linechart.png
9 9
10 To create line charts, QLineSeries instance is needed. Here we create two line series and we set the color and width of line.
10 To create line chart, QLineSeries instance is needed. Let's create one.
11 11
12 12 \snippet ../examples/linechart/main.cpp 1
13 13
14 We add data to be shown to both series. We can use add() member function or use stream operator.
14 Then we add data to series. We can use add() member function or use stream operator.
15 15
16 16 \snippet ../examples/linechart/main.cpp 2
17 17
18 In the end we create QChartView instance, set title, set anti-aliasing and add both series.
18 To present the data on the char we need QChart instance. We add the series to it and set the title of the chart.
19 19
20 20 \snippet ../examples/linechart/main.cpp 3
21
22 Chart is ready to be shown.
21
22 Then we create a QChartView object with QChart as a parameter. This way we don't need to create QGraphicsView scene ourselves. We also set the Antialiasing on to have the rendered lines look nicer.
23 23
24 24 \snippet ../examples/linechart/main.cpp 4
25
26 Chart is ready to be shown.
27
28 \snippet ../examples/linechart/main.cpp 5
25 29
26 */ No newline at end of file
30 */
@@ -31,9 +31,6 int main(int argc, char *argv[])
31 31
32 32 //![1]
33 33 QLineSeries* series = new QLineSeries();
34 QPen red(Qt::red);
35 red.setWidth(3);
36 series->setPen(red);
37 34 //![1]
38 35
39 36 //![2]
@@ -34,9 +34,9 int main(int argc, char *argv[])
34 34 //![1]
35 35
36 36 //![2]
37 QPen red(Qt::red);
38 red.setWidth(3);
39 series->setPen(red);
37 // QPen red(Qt::red);
38 // red.setWidth(3);
39 // series->setPen(red);
40 40 //![2]
41 41
42 42 //![3]
General Comments 0
You need to be logged in to leave comments. Login now