##// END OF EJS Templates
Make scatterinteractions compile
Jani Honkonen -
r831:d1edc6bf68da
parent child
Show More
@@ -13,7 +13,7 SUBDIRS += \
13 piechartdrilldown \
13 piechartdrilldown \
14 #presenterchart \
14 #presenterchart \
15 scatterchart \
15 scatterchart \
16 #scatterinteractions \
16 scatterinteractions \
17 #splinechart \
17 #splinechart \
18 stackedbarchart \
18 stackedbarchart \
19 stackedbarchartdrilldown \
19 stackedbarchartdrilldown \
@@ -19,20 +19,15
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 #include "mainwindow.h"
21 #include "mainwindow.h"
22 #include <qchartglobal.h>
22 #include <QChartView>
23 #include <qchartview.h>
24 #include <qchartaxis.h>
25 #include <QDebug>
26
23
27 QTCOMMERCIALCHART_USE_NAMESPACE
24 QTCOMMERCIALCHART_USE_NAMESPACE
28
25
29 MainWindow::MainWindow(QWidget *parent)
26 MainWindow::MainWindow(QWidget *parent)
30 : QMainWindow(parent)
27 : QMainWindow(parent)
31 {
28 {
32 QChartView *chartView = new QChartView(this);
29 QChart *chart = new QChart();
33 chartView->setChartTitle("Click to remove scatter point");
30 chart->setTitle("Click to remove scatter point");
34 chartView->setRenderHint(QPainter::Antialiasing);
35 setCentralWidget(chartView);
36
31
37 m_scatter = new QScatterSeries();
32 m_scatter = new QScatterSeries();
38 for(qreal x(0.5); x <= 4.0; x += 0.5) {
33 for(qreal x(0.5); x <= 4.0; x += 0.5) {
@@ -41,11 +36,15 MainWindow::MainWindow(QWidget *parent)
41 }
36 }
42 }
37 }
43
38
44 chartView->addSeries(m_scatter);
39 chart->addSeries(m_scatter);
45 chartView->axisX()->setRange(0,4.5);
40 chart->axisX()->setRange(0, 4.5);
46 chartView->axisY()->setRange(0,4.5);
41 chart->axisY()->setRange(0, 4.5);
47
42
48 connect(m_scatter, SIGNAL(clicked(const QPointF&)), this, SLOT(handleClickedPoint(const QPointF&)));
43 connect(m_scatter, SIGNAL(clicked(const QPointF&)), this, SLOT(handleClickedPoint(const QPointF&)));
44
45 QChartView *chartView = new QChartView(chart);
46 chartView->setRenderHint(QPainter::Antialiasing);
47 setCentralWidget(chartView);
49 }
48 }
50
49
51 MainWindow::~MainWindow()
50 MainWindow::~MainWindow()
General Comments 0
You need to be logged in to leave comments. Login now