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