@@ -60,7 +60,7 Rectangle { | |||||
60 |
|
60 | |||
61 | // A timer to refresh the forecast every 5 minutes |
|
61 | // A timer to refresh the forecast every 5 minutes | |
62 | Timer { |
|
62 | Timer { | |
63 |
interval: 300000 |
|
63 | interval: 300000 | |
64 | repeat: true |
|
64 | repeat: true | |
65 | triggeredOnStart: true |
|
65 | triggeredOnStart: true | |
66 | running: true |
|
66 | running: true |
@@ -44,6 +44,7 int main(int argc, char *argv[]) | |||||
44 |
|
44 | |||
45 | //![3] |
|
45 | //![3] | |
46 | QAreaSeries* series = new QAreaSeries(series0, series1); |
|
46 | QAreaSeries* series = new QAreaSeries(series0, series1); | |
|
47 | series->setName("Batman"); | |||
47 | QPen pen(0x059605); |
|
48 | QPen pen(0x059605); | |
48 | pen.setWidth(3); |
|
49 | pen.setWidth(3); | |
49 | series->setPen(pen); |
|
50 | series->setPen(pen); |
@@ -31,6 +31,7 int main(int argc, char *argv[]) | |||||
31 |
|
31 | |||
32 | //![1] |
|
32 | //![1] | |
33 | QLineSeries* series = new QLineSeries(); |
|
33 | QLineSeries* series = new QLineSeries(); | |
|
34 | series->setName("line"); | |||
34 | *series << QPointF(0, 6) << QPointF(2, 4) << QPointF(3, 8) << QPointF(7, 4) << QPointF(10,5); |
|
35 | *series << QPointF(0, 6) << QPointF(2, 4) << QPointF(3, 8) << QPointF(7, 4) << QPointF(10,5); | |
35 | QChart* chart = new QChart(); |
|
36 | QChart* chart = new QChart(); | |
36 | chart->addSeries(series); |
|
37 | chart->addSeries(series); |
@@ -31,6 +31,7 int main(int argc, char *argv[]) | |||||
31 |
|
31 | |||
32 | //![1] |
|
32 | //![1] | |
33 | QLineSeries* series = new QLineSeries(); |
|
33 | QLineSeries* series = new QLineSeries(); | |
|
34 | series->setName("line"); | |||
34 | //![1] |
|
35 | //![1] | |
35 |
|
36 | |||
36 | //![2] |
|
37 | //![2] |
@@ -55,6 +55,7 TableWidget::TableWidget(QWidget *parent) | |||||
55 | // series 1 |
|
55 | // series 1 | |
56 | //! [4] |
|
56 | //! [4] | |
57 | QLineSeries *series = new QLineSeries; |
|
57 | QLineSeries *series = new QLineSeries; | |
|
58 | series->setName("line1"); | |||
58 | series->setModel(model); |
|
59 | series->setModel(model); | |
59 |
|
60 | |||
60 | QXYModelMapper *mapper = new QXYModelMapper; |
|
61 | QXYModelMapper *mapper = new QXYModelMapper; | |
@@ -77,6 +78,7 TableWidget::TableWidget(QWidget *parent) | |||||
77 | // series 2 |
|
78 | // series 2 | |
78 | //! [6] |
|
79 | //! [6] | |
79 | series = new QLineSeries; |
|
80 | series = new QLineSeries; | |
|
81 | series->setName("line2"); | |||
80 | series->setModel(model); |
|
82 | series->setModel(model); | |
81 |
|
83 | |||
82 | mapper = new QXYModelMapper; |
|
84 | mapper = new QXYModelMapper; |
@@ -35,22 +35,26 m_index(-1),m_chart(chart) | |||||
35 |
|
35 | |||
36 | //![1] |
|
36 | //![1] | |
37 | QLineSeries* series0 = new QLineSeries(); |
|
37 | QLineSeries* series0 = new QLineSeries(); | |
|
38 | series0->setName("line"); | |||
38 | QPen blue(Qt::blue); |
|
39 | QPen blue(Qt::blue); | |
39 | blue.setWidth(3); |
|
40 | blue.setWidth(3); | |
40 | series0->setPen(blue); |
|
41 | series0->setPen(blue); | |
41 |
|
42 | |||
42 | QScatterSeries* series1 = new QScatterSeries(); |
|
43 | QScatterSeries* series1 = new QScatterSeries(); | |
|
44 | series1->setName("scatter"); | |||
43 | QPen red(Qt::red); |
|
45 | QPen red(Qt::red); | |
44 | red.setWidth(3); |
|
46 | red.setWidth(3); | |
45 | series1->setPen(red); |
|
47 | series1->setPen(red); | |
46 | series1->setBrush(Qt::white); |
|
48 | series1->setBrush(Qt::white); | |
47 |
|
49 | |||
48 | QSplineSeries* series2 = new QSplineSeries(); |
|
50 | QSplineSeries* series2 = new QSplineSeries(); | |
|
51 | series2->setName("spline"); | |||
49 | QPen green(Qt::green); |
|
52 | QPen green(Qt::green); | |
50 | green.setWidth(3); |
|
53 | green.setWidth(3); | |
51 | series2->setPen(green); |
|
54 | series2->setPen(green); | |
52 |
|
55 | |||
53 | QAreaSeries* series3 = new QAreaSeries(series0); |
|
56 | QAreaSeries* series3 = new QAreaSeries(series0); | |
|
57 | series3->setName("area"); | |||
54 | QPen yellow(Qt::black); |
|
58 | QPen yellow(Qt::black); | |
55 | yellow.setWidth(3); |
|
59 | yellow.setWidth(3); | |
56 | series3->setPen(yellow); |
|
60 | series3->setPen(yellow); |
@@ -6,10 +6,12 ChartView::ChartView(QWidget *parent) : | |||||
6 | { |
|
6 | { | |
7 | //![1] |
|
7 | //![1] | |
8 | QScatterSeries *series0 = new QScatterSeries(); |
|
8 | QScatterSeries *series0 = new QScatterSeries(); | |
|
9 | series0->setName("scatter1"); | |||
9 | series0->setShape(QScatterSeries::MarkerShapeCircle); |
|
10 | series0->setShape(QScatterSeries::MarkerShapeCircle); | |
10 | series0->setSize(15.0); |
|
11 | series0->setSize(15.0); | |
11 |
|
12 | |||
12 | QScatterSeries *series1 = new QScatterSeries(); |
|
13 | QScatterSeries *series1 = new QScatterSeries(); | |
|
14 | series1->setName("scatter2"); | |||
13 | series1->setShape(QScatterSeries::MarkerShapeCircle); |
|
15 | series1->setShape(QScatterSeries::MarkerShapeCircle); | |
14 | series1->setSize(20.0); |
|
16 | series1->setSize(20.0); | |
15 | //![1] |
|
17 | //![1] |
@@ -32,12 +32,14 ChartView::ChartView(QWidget *parent) | |||||
32 | chart()->setTitle("Click to interact with scatter points"); |
|
32 | chart()->setTitle("Click to interact with scatter points"); | |
33 |
|
33 | |||
34 | m_scatter = new QScatterSeries(); |
|
34 | m_scatter = new QScatterSeries(); | |
|
35 | m_scatter->setName("scatter1"); | |||
35 | for(qreal x(0.5); x <= 4.0; x += 0.5) { |
|
36 | for(qreal x(0.5); x <= 4.0; x += 0.5) { | |
36 | for(qreal y(0.5); y <= 4.0; y += 0.5) { |
|
37 | for(qreal y(0.5); y <= 4.0; y += 0.5) { | |
37 | *m_scatter << QPointF(x, y); |
|
38 | *m_scatter << QPointF(x, y); | |
38 | } |
|
39 | } | |
39 | } |
|
40 | } | |
40 | m_scatter2 = new QScatterSeries(); |
|
41 | m_scatter2 = new QScatterSeries(); | |
|
42 | m_scatter2->setName("scatter2"); | |||
41 |
|
43 | |||
42 | chart()->addSeries(m_scatter2); |
|
44 | chart()->addSeries(m_scatter2); | |
43 | chart()->addSeries(m_scatter); |
|
45 | chart()->addSeries(m_scatter); |
@@ -31,6 +31,7 int main(int argc, char *argv[]) | |||||
31 |
|
31 | |||
32 | //![1] |
|
32 | //![1] | |
33 | QSplineSeries* series = new QSplineSeries(); |
|
33 | QSplineSeries* series = new QSplineSeries(); | |
|
34 | series->setName("spline"); | |||
34 | //![1] |
|
35 | //![1] | |
35 |
|
36 | |||
36 | //![2] |
|
37 | //![2] |
@@ -32,6 +32,7 int main(int argc, char *argv[]) | |||||
32 |
|
32 | |||
33 | //![1] |
|
33 | //![1] | |
34 | QLineSeries* series = new QLineSeries(); |
|
34 | QLineSeries* series = new QLineSeries(); | |
|
35 | series->setName("line"); | |||
35 | qreal yValue = 0.0; |
|
36 | qreal yValue = 0.0; | |
36 | for (int i(0); i < 500; i++) { |
|
37 | for (int i(0); i < 500; i++) { | |
37 | yValue = yValue + (qreal) (qrand() % 10) / 500.0; |
|
38 | yValue = yValue + (qreal) (qrand() % 10) / 500.0; |
General Comments 0
You need to be logged in to leave comments.
Login now