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