@@ -13,7 +13,7 SUBDIRS += \ | |||
|
13 | 13 | piechartdrilldown \ |
|
14 | 14 | #presenterchart \ |
|
15 | 15 | scatterchart \ |
|
16 |
|
|
|
16 | scatterinteractions \ | |
|
17 | 17 | #splinechart \ |
|
18 | 18 | stackedbarchart \ |
|
19 | 19 | stackedbarchartdrilldown \ |
@@ -19,20 +19,15 | |||
|
19 | 19 | ****************************************************************************/ |
|
20 | 20 | |
|
21 | 21 | #include "mainwindow.h" |
|
22 |
#include < |
|
|
23 | #include <qchartview.h> | |
|
24 | #include <qchartaxis.h> | |
|
25 | #include <QDebug> | |
|
22 | #include <QChartView> | |
|
26 | 23 | |
|
27 | 24 | QTCOMMERCIALCHART_USE_NAMESPACE |
|
28 | 25 | |
|
29 | 26 | MainWindow::MainWindow(QWidget *parent) |
|
30 | 27 | : QMainWindow(parent) |
|
31 | 28 | { |
|
32 |
QChart |
|
|
33 |
chart |
|
|
34 | chartView->setRenderHint(QPainter::Antialiasing); | |
|
35 | setCentralWidget(chartView); | |
|
29 | QChart *chart = new QChart(); | |
|
30 | chart->setTitle("Click to remove scatter point"); | |
|
36 | 31 | |
|
37 | 32 | m_scatter = new QScatterSeries(); |
|
38 | 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 |
chart |
|
|
45 |
chart |
|
|
46 |
chart |
|
|
39 | chart->addSeries(m_scatter); | |
|
40 | chart->axisX()->setRange(0, 4.5); | |
|
41 | chart->axisY()->setRange(0, 4.5); | |
|
47 | 42 | |
|
48 | 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 | 50 | MainWindow::~MainWindow() |
General Comments 0
You need to be logged in to leave comments.
Login now