##// END OF EJS Templates
Spline series fix
Marek Rosa -
r450:145a5bfaccbf
parent child
Show More
@@ -56,7 +56,7 int main(int argc, char *argv[])
56 56 categoriesX.insert(100,"High");
57 57
58 58 axisX->setMin(-10);
59 axisX->setMax(200);
59 axisX->setMax(2200);
60 60
61 61 QChartAxis* axisY = chartView->axisY();
62 62 axisY->setLabelsAngle(45);
@@ -16,6 +16,6 SUBDIRS += linechart \
16 16 presenterchart \
17 17 chartview \
18 18 scatterinteractions \
19 #splinechart \
19 splinechart \
20 20 areachart \
21 21 stackedbarchartdrilldown
@@ -14,7 +14,7 SplineWidget::SplineWidget(QWidget *parent)
14 14 qsrand(time(NULL));
15 15 //! [1]
16 16 //create QSplineSeries
17 series = new QSplineSeries(this);
17 series = new QSplineSeries;
18 18 //! [1]
19 19
20 20 //! [2]
@@ -47,8 +47,15 SplineWidget::SplineWidget(QWidget *parent)
47 47 QChartView* chart = new QChartView;
48 48 chart->addSeries(series);
49 49
50 chart->axisX()->setRange(0, 1500);
51 chart->axisY()->setRange(0, 400);
50 chart->setChartTitle("Spline chart example");
51
52 // chart->setMinimumSize(800,600);
53 // chart->axisX()->setRange(0, 1500);
54
55 // chart->axisX()->setMax(1500);
56 // chart->axisY()->setRange(0, 400);
57 chart->axisX()->setMax(1500);
58 // chart->
52 59
53 60 chart->setMinimumSize(800,600);
54 61 //! [3]
@@ -253,6 +253,8 void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain)
253 253 QSplineSeries* splineSeries = qobject_cast<QSplineSeries*>(series);
254 254 SplinePresenter* splinePresenter = new SplinePresenter(splineSeries, m_chart);
255 255 QObject::connect(this, SIGNAL(geometryChanged(const QRectF&)), splinePresenter, SLOT(handleGeometryChanged(const QRectF&)));
256 //initialize
257 splinePresenter->handleDomainChanged(domain->minX(),domain->maxX(),domain->minY(),domain->maxY());
256 258 m_chartTheme->decorate(splinePresenter, splineSeries, m_chartItems.count());
257 259 m_chartItems.insert(splineSeries, splinePresenter);
258 260 break;
@@ -53,7 +53,7 void SplinePresenter::paint(QPainter *painter, const QStyleOptionGraphicsItem *o
53 53 painter->drawPath(m_path);
54 54
55 55 QSplineSeries* splineSeries = qobject_cast<QSplineSeries*>(m_series);
56 for (int i = 0; i < splineSeries->count() - 1; i++)
56 for (int i = 0; i < m_points.size() - 1; i++)
57 57 {
58 58 painter->setPen(Qt::red);
59 59 painter->drawEllipse(m_points[i], 2, 2);
General Comments 0
You need to be logged in to leave comments. Login now