@@ -29,31 +29,22 int main(int argc, char *argv[]) | |||||
29 | { |
|
29 | { | |
30 | QApplication a(argc, argv); |
|
30 | QApplication a(argc, argv); | |
31 | //![1] |
|
31 | //![1] | |
32 |
QLineSeries* series |
|
32 | QLineSeries* series = new QLineSeries(); | |
33 | QPen blue(Qt::blue); |
|
|||
34 | blue.setWidth(3); |
|
|||
35 | series0->setPen(blue); |
|
|||
36 |
|
||||
37 | QLineSeries* series1 = new QLineSeries(); |
|
|||
38 | QPen red(Qt::red); |
|
33 | QPen red(Qt::red); | |
39 | red.setWidth(3); |
|
34 | red.setWidth(3); | |
40 |
series |
|
35 | series->setPen(red); | |
41 | //![1] |
|
36 | //![1] | |
42 |
|
||||
43 | //![2] |
|
37 | //![2] | |
44 |
series |
|
38 | series->append(0, 6); | |
45 |
series |
|
39 | series->append(2, 4); | |
46 |
series |
|
40 | series->append(3, 8); | |
47 |
series |
|
41 | series->append(7, 4); | |
48 |
series |
|
42 | series->append(10, 5); | |
49 |
|
43 | *series << QPointF(11, 1) << QPointF(13, 3) << QPointF(17, 6) << QPointF(18, 3) << QPointF(20, 2); | ||
50 | *series1 << QPointF(1, 1) << QPointF(3, 3) << QPointF(7, 6) << QPointF(8, 3) << QPointF(10, 2); |
|
|||
51 | //![2] |
|
44 | //![2] | |
52 | //![3] |
|
45 | //![3] | |
53 | QChart* chart = new QChart(); |
|
46 | QChart* chart = new QChart(); | |
54 |
|
47 | chart->addSeries(series); | ||
55 | chart->addSeries(series0); |
|
|||
56 | chart->addSeries(series1); |
|
|||
57 | chart->setTitle("Simple line chart example"); |
|
48 | chart->setTitle("Simple line chart example"); | |
58 | //![3] |
|
49 | //![3] | |
59 | //![4] |
|
50 | //![4] |
General Comments 0
You need to be logged in to leave comments.
Login now