@@ -59,6 +59,10 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||
|
59 | 59 | QSplineSeries::QSplineSeries(QObject *parent) : |
|
60 | 60 | QLineSeries(*new QSplineSeriesPrivate(this),parent) |
|
61 | 61 | { |
|
62 | Q_D(QSplineSeries); | |
|
63 | QObject::connect(this,SIGNAL(pointAdded(int)), d, SLOT(updateControlPoints())); | |
|
64 | QObject::connect(this,SIGNAL(pointRemoved(int)), d, SLOT(updateControlPoints())); | |
|
65 | QObject::connect(this,SIGNAL(pointReplaced(int)), d, SLOT(updateControlPoints())); | |
|
62 | 66 | } |
|
63 | 67 | |
|
64 | 68 | QSplineSeries::~QSplineSeries() |
@@ -78,9 +82,9 QAbstractSeries::SeriesType QSplineSeries::type() const | |||
|
78 | 82 | |
|
79 | 83 | QSplineSeriesPrivate::QSplineSeriesPrivate(QSplineSeries* q):QLineSeriesPrivate(q) |
|
80 | 84 | { |
|
81 | QObject::connect(this,SIGNAL(pointAdded(int)), this, SLOT(updateControlPoints())); | |
|
82 | QObject::connect(this,SIGNAL(pointRemoved(int)), this, SLOT(updateControlPoints())); | |
|
83 | QObject::connect(this,SIGNAL(pointReplaced(int)), this, SLOT(updateControlPoints())); | |
|
85 | // QObject::connect(this,SIGNAL(pointAdded(int)), this, SLOT(updateControlPoints())); | |
|
86 | // QObject::connect(this,SIGNAL(pointRemoved(int)), this, SLOT(updateControlPoints())); | |
|
87 | // QObject::connect(this,SIGNAL(pointReplaced(int)), this, SLOT(updateControlPoints())); | |
|
84 | 88 | }; |
|
85 | 89 | |
|
86 | 90 | /*! |
@@ -210,7 +210,7 void TableWidget::updateChartType(bool toggle) | |||
|
210 | 210 | |
|
211 | 211 | if (m_lineRadioButton->isChecked()) |
|
212 | 212 | { |
|
213 |
|
|
|
213 | m_chart->setAnimationOptions(QChart::NoAnimation); | |
|
214 | 214 | |
|
215 | 215 | // series 1 |
|
216 | 216 | m_series = new QLineSeries(this); |
@@ -221,7 +221,7 void TableWidget::updateChartType(bool toggle) | |||
|
221 | 221 | mapper->setXColumn(0); |
|
222 | 222 | mapper->setYColumn(1); |
|
223 | 223 | mapper->setFirst(3); |
|
224 |
|
|
|
224 | mapper->setCount(4); | |
|
225 | 225 | |
|
226 | 226 | // m_series->setModelMapping(0,1, Qt::Vertical); |
|
227 | 227 | // m_series->setModelMappingRange(3, 4); |
@@ -262,23 +262,25 void TableWidget::updateChartType(bool toggle) | |||
|
262 | 262 | } |
|
263 | 263 | else if (m_splineRadioButton->isChecked()) |
|
264 | 264 | { |
|
265 |
|
|
|
265 | m_chart->setAnimationOptions(QChart::NoAnimation); | |
|
266 | 266 | |
|
267 |
|
|
|
268 |
|
|
|
269 |
|
|
|
267 | // series 1 | |
|
268 | m_series = new QSplineSeries; | |
|
269 | // m_series->setModel(m_model); | |
|
270 | 270 | |
|
271 |
|
|
|
272 |
|
|
|
273 |
|
|
|
274 |
|
|
|
275 |
|
|
|
271 | QVXYModelMapper *mapper = new QVXYModelMapper; | |
|
272 | mapper->setSeries(m_series); | |
|
273 | mapper->setModel(m_model); | |
|
274 | mapper->setXColumn(0); | |
|
275 | mapper->setYColumn(1); | |
|
276 | mapper->setFirst(0); | |
|
277 | mapper->setCount(-1); | |
|
276 | 278 | |
|
277 |
|
|
|
279 | // m_series->setModelMapper(mapper); | |
|
278 | 280 | |
|
279 |
|
|
|
280 |
|
|
|
281 |
|
|
|
281 | m_chart->addSeries(m_series); | |
|
282 | seriesColorHex = "#" + QString::number(m_series->pen().color().rgb(), 16).right(6).toUpper(); | |
|
283 | m_model->addMapping(seriesColorHex, QRect(0, 0, 2, 1000)); | |
|
282 | 284 | |
|
283 | 285 | // // series 2 |
|
284 | 286 | // m_series = new QSplineSeries; |
@@ -524,9 +526,9 void TableWidget::testPie3() | |||
|
524 | 526 | |
|
525 | 527 | void TableWidget::testXY() |
|
526 | 528 | { |
|
527 | // if (m_series->type() != QAbstractSeries::SeriesTypeLine) { | |
|
528 | // m_series->append(QPointF(150, 75)); | |
|
529 | // } | |
|
529 | // if (m_series->type() != QAbstractSeries::SeriesTypeLine) { | |
|
530 | // m_series->append(QPointF(150, 75)); | |
|
531 | // } | |
|
530 | 532 | |
|
531 | 533 | if (m_series->count() > 0) { |
|
532 | 534 | m_series->remove(m_series->points().last()); |
General Comments 0
You need to be logged in to leave comments.
Login now