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