@@ -57,6 +57,12 void PolarChartAxis::updateLayout(QVector<qreal> &layout) | |||
|
57 | 57 | |
|
58 | 58 | if (animation()) { |
|
59 | 59 | switch (presenter()->state()) { |
|
60 | case ChartPresenter::ZoomInState: | |
|
61 | case ChartPresenter::ZoomOutState: | |
|
62 | case ChartPresenter::ScrollUpState: | |
|
63 | case ChartPresenter::ScrollLeftState: | |
|
64 | case ChartPresenter::ScrollDownState: | |
|
65 | case ChartPresenter::ScrollRightState: | |
|
60 | 66 | case ChartPresenter::ShowState: |
|
61 | 67 | animation()->setAnimationType(AxisAnimation::DefaultAnimation); |
|
62 | 68 | break; |
@@ -99,11 +99,11 void PolarChartAxisAngular::updateGeometry() | |||
|
99 | 99 | if (i == (layout.size() - 1)) |
|
100 | 100 | farEdge = 360.0; |
|
101 | 101 | else |
|
102 | farEdge = qMin(360.0, layout.at(i + 1)); | |
|
102 | farEdge = qMin(qreal(360.0), layout.at(i + 1)); | |
|
103 | 103 | |
|
104 | 104 | // Adjust the labelCoordinate to show it if next tick is visible |
|
105 | 105 | if (nextTickVisible) |
|
106 | labelCoordinate = qMax(0.0, labelCoordinate); | |
|
106 | labelCoordinate = qMax(qreal(0.0), labelCoordinate); | |
|
107 | 107 | |
|
108 | 108 | labelCoordinate = (labelCoordinate + farEdge) / 2.0; |
|
109 | 109 | // Don't display label once the category gets too small near the axis |
@@ -316,8 +316,6 qreal PolarChartAxisAngular::preferredAxisRadius(const QSizeF &maxSize) | |||
|
316 | 316 | if (maxSize.width() < maxSize.height()) |
|
317 | 317 | radius = maxSize.width() / 2.0; |
|
318 | 318 | |
|
319 | int labelHeight = 0; | |
|
320 | ||
|
321 | 319 | if (axis()->labelsVisible()) { |
|
322 | 320 | QVector<qreal> layout = calculateLayout(); |
|
323 | 321 | if (layout.isEmpty()) |
@@ -353,11 +351,11 qreal PolarChartAxisAngular::preferredAxisRadius(const QSizeF &maxSize) | |||
|
353 | 351 | if (i == (layout.size() - 1)) |
|
354 | 352 | farEdge = 360.0; |
|
355 | 353 | else |
|
356 | farEdge = qMin(360.0, layout.at(i + 1)); | |
|
354 | farEdge = qMin(qreal(360.0), layout.at(i + 1)); | |
|
357 | 355 | |
|
358 | 356 | // Adjust the labelCoordinate to show it if next tick is visible |
|
359 | 357 | if (nextTickVisible) |
|
360 | labelCoordinate = qMax(0.0, labelCoordinate); | |
|
358 | labelCoordinate = qMax(qreal(0.0), labelCoordinate); | |
|
361 | 359 | |
|
362 | 360 | labelCoordinate = (labelCoordinate + farEdge) / 2.0; |
|
363 | 361 | } |
@@ -373,7 +371,6 qreal PolarChartAxisAngular::preferredAxisRadius(const QSizeF &maxSize) | |||
|
373 | 371 | } |
|
374 | 372 | |
|
375 | 373 | QRectF boundingRect = labelBoundingRect(fm, labelList.at(i)); |
|
376 | labelHeight = boundingRect.height(); | |
|
377 | 374 | QPointF labelPoint = QLineF::fromPolar(radius + tickWidth(), 90.0 - labelCoordinate).p2(); |
|
378 | 375 | |
|
379 | 376 | boundingRect = moveLabelToPosition(labelCoordinate, labelPoint, boundingRect); |
@@ -97,7 +97,7 void PolarChartAxisRadial::updateGeometry() | |||
|
97 | 97 | |
|
98 | 98 | // Adjust the labelCoordinate to show it if next tick is visible |
|
99 | 99 | if (nextTickVisible) |
|
100 | labelCoordinate = qMax(0.0, labelCoordinate); | |
|
100 | labelCoordinate = qMax(qreal(0.0), labelCoordinate); | |
|
101 | 101 | |
|
102 | 102 | labelCoordinate = (labelCoordinate + farEdge) / 2.0; |
|
103 | 103 | if (labelCoordinate > 0.0 && labelCoordinate < radius) |
@@ -67,11 +67,11 public: | |||
|
67 | 67 | } |
|
68 | 68 | |
|
69 | 69 | QString compilationTime() { |
|
70 | return buildTime; | |
|
70 | return QString(buildTime); | |
|
71 | 71 | } |
|
72 | 72 | |
|
73 | 73 | QString compilationHead() { |
|
74 | return gitHead; | |
|
74 | return QString(gitHead); | |
|
75 | 75 | } |
|
76 | 76 | |
|
77 | 77 | private: |
@@ -667,11 +667,11 QPointF QChart::mapToPosition(const QPointF &value, QAbstractSeries *series) | |||
|
667 | 667 | |
|
668 | 668 | QChartPrivate::QChartPrivate(QChart *q, QChart::ChartType type): |
|
669 | 669 | q_ptr(q), |
|
670 | m_type(type), | |
|
671 | 670 | m_legend(0), |
|
672 | 671 | m_dataset(new ChartDataSet(q)), |
|
673 | 672 | m_presenter(new ChartPresenter(q, type)), |
|
674 | m_themeManager(new ChartThemeManager(q)) | |
|
673 | m_themeManager(new ChartThemeManager(q)), | |
|
674 | m_type(type) | |
|
675 | 675 | { |
|
676 | 676 | QObject::connect(m_dataset, SIGNAL(seriesAdded(QAbstractSeries*)), m_presenter, SLOT(handleSeriesAdded(QAbstractSeries*))); |
|
677 | 677 | QObject::connect(m_dataset, SIGNAL(seriesRemoved(QAbstractSeries*)), m_presenter, SLOT(handleSeriesRemoved(QAbstractSeries*))); |
@@ -23,6 +23,7 | |||
|
23 | 23 | #include "qchart_p.h" |
|
24 | 24 | #include <QGraphicsScene> |
|
25 | 25 | #include <QRubberBand> |
|
26 | #include <qmath.h> | |
|
26 | 27 | |
|
27 | 28 | /*! |
|
28 | 29 | \enum QChartView::RubberBand |
@@ -263,7 +264,7 void QChartViewPrivate::resize() | |||
|
263 | 264 | { |
|
264 | 265 | // Flip chart width and height if the view has been rotated |
|
265 | 266 | // more than 45 degrees from the horizontal so it fits better into the view. |
|
266 |
qreal angle = |
|
|
267 | qreal angle = qAcos(q_ptr->transform().m11()) * rad2deg; | |
|
267 | 268 | QSize chartSize = q_ptr->size(); |
|
268 | 269 | |
|
269 | 270 | if (angle > 45.0 && angle < 135.0) { |
General Comments 0
You need to be logged in to leave comments.
Login now