##// 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
NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -11,10 +11,6
11
11
12 \snippet ../examples/splinechart/main.cpp 1
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 Now lets add some data points to the series.
14 Now lets add some data points to the series.
19
15
20 \snippet ../examples/splinechart/main.cpp 3
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 \snippet ../examples/splinechart/main.cpp 4
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 \snippet ../examples/splinechart/main.cpp 5
24 \snippet ../examples/splinechart/main.cpp 5
29
25
@@ -7,20 +7,24
7
7
8 \image linechart.png
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 \snippet ../examples/linechart/main.cpp 1
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 \snippet ../examples/linechart/main.cpp 2
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 \snippet ../examples/linechart/main.cpp 3
20 \snippet ../examples/linechart/main.cpp 3
21
21
22 Chart is ready to be shown.
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 \snippet ../examples/linechart/main.cpp 4
24 \snippet ../examples/linechart/main.cpp 4
25
25
26 Chart is ready to be shown.
27
28 \snippet ../examples/linechart/main.cpp 5
29
26 */
30 */
@@ -31,9 +31,6 int main(int argc, char *argv[])
31
31
32 //![1]
32 //![1]
33 QLineSeries* series = new QLineSeries();
33 QLineSeries* series = new QLineSeries();
34 QPen red(Qt::red);
35 red.setWidth(3);
36 series->setPen(red);
37 //![1]
34 //![1]
38
35
39 //![2]
36 //![2]
@@ -34,9 +34,9 int main(int argc, char *argv[])
34 //![1]
34 //![1]
35
35
36 //![2]
36 //![2]
37 QPen red(Qt::red);
37 // QPen red(Qt::red);
38 red.setWidth(3);
38 // red.setWidth(3);
39 series->setPen(red);
39 // series->setPen(red);
40 //![2]
40 //![2]
41
41
42 //![3]
42 //![3]
General Comments 0
You need to be logged in to leave comments. Login now