@@ -43,13 +43,16 void HorizontalBarChartItem::initializeLayout() | |||||
43 | QPointF topLeft; |
|
43 | QPointF topLeft; | |
44 | QPointF bottomRight; |
|
44 | QPointF bottomRight; | |
45 | if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) { |
|
45 | if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) { | |
46 | topLeft = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category - barWidth / 2 + set/setCount * barWidth)); |
|
46 | topLeft = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category - barWidth / 2 + set/setCount * barWidth), m_validData); | |
47 | bottomRight = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category + barWidth / 2 + (set + 1)/setCount * barWidth)); |
|
47 | bottomRight = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category + barWidth / 2 + (set + 1)/setCount * barWidth), m_validData); | |
48 | } else { |
|
48 | } else { | |
49 | topLeft = domain()->calculateGeometryPoint(QPointF(0, category - barWidth / 2 + set/setCount * barWidth)); |
|
49 | topLeft = domain()->calculateGeometryPoint(QPointF(0, category - barWidth / 2 + set/setCount * barWidth), m_validData); | |
50 | bottomRight = domain()->calculateGeometryPoint(QPointF(0, category - barWidth / 2 + (set + 1)/setCount * barWidth)); |
|
50 | bottomRight = domain()->calculateGeometryPoint(QPointF(0, category - barWidth / 2 + (set + 1)/setCount * barWidth), m_validData); | |
51 | } |
|
51 | } | |
52 |
|
52 | |||
|
53 | if (!m_validData) | |||
|
54 | return; | |||
|
55 | ||||
53 | rect.setTopLeft(topLeft); |
|
56 | rect.setTopLeft(topLeft); | |
54 | rect.setBottomRight(bottomRight); |
|
57 | rect.setBottomRight(bottomRight); | |
55 | m_layout.append(rect.normalized()); |
|
58 | m_layout.append(rect.normalized()); | |
@@ -72,11 +75,15 QVector<QRectF> HorizontalBarChartItem::calculateLayout() | |||||
72 | QRectF rect; |
|
75 | QRectF rect; | |
73 | QPointF topLeft; |
|
76 | QPointF topLeft; | |
74 | if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) |
|
77 | if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) | |
75 | topLeft = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category - barWidth / 2 + set/setCount * barWidth)); |
|
78 | topLeft = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category - barWidth / 2 + set/setCount * barWidth), m_validData); | |
76 | else |
|
79 | else | |
77 | topLeft = domain()->calculateGeometryPoint(QPointF(0, category - barWidth / 2 + set/setCount * barWidth)); |
|
80 | topLeft = domain()->calculateGeometryPoint(QPointF(0, category - barWidth / 2 + set/setCount * barWidth), m_validData); | |
|
81 | ||||
|
82 | QPointF bottomRight = domain()->calculateGeometryPoint(QPointF(value, category - barWidth / 2 + (set + 1)/setCount * barWidth), m_validData); | |||
|
83 | ||||
|
84 | if (!m_validData) | |||
|
85 | return QVector<QRectF>(); | |||
78 |
|
86 | |||
79 | QPointF bottomRight = domain()->calculateGeometryPoint(QPointF(value, category - barWidth / 2 + (set + 1)/setCount * barWidth)); |
|
|||
80 | rect.setTopLeft(topLeft); |
|
87 | rect.setTopLeft(topLeft); | |
81 | rect.setBottomRight(bottomRight); |
|
88 | rect.setBottomRight(bottomRight); | |
82 | layout.append(rect.normalized()); |
|
89 | layout.append(rect.normalized()); |
@@ -43,13 +43,16 void HorizontalPercentBarChartItem::initializeLayout() | |||||
43 | QPointF topLeft; |
|
43 | QPointF topLeft; | |
44 | QPointF bottomRight; |
|
44 | QPointF bottomRight; | |
45 | if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) { |
|
45 | if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) { | |
46 | topLeft = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category - barWidth / 2)); |
|
46 | topLeft = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category - barWidth / 2), m_validData); | |
47 | bottomRight = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category + barWidth / 2)); |
|
47 | bottomRight = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category + barWidth / 2), m_validData); | |
48 | } else { |
|
48 | } else { | |
49 | topLeft = domain()->calculateGeometryPoint(QPointF(0, category - barWidth / 2)); |
|
49 | topLeft = domain()->calculateGeometryPoint(QPointF(0, category - barWidth / 2), m_validData); | |
50 | bottomRight = domain()->calculateGeometryPoint(QPointF(0, category + barWidth / 2)); |
|
50 | bottomRight = domain()->calculateGeometryPoint(QPointF(0, category + barWidth / 2), m_validData); | |
51 | } |
|
51 | } | |
52 |
|
52 | |||
|
53 | if (!m_validData) | |||
|
54 | return; | |||
|
55 | ||||
53 | rect.setTopLeft(topLeft); |
|
56 | rect.setTopLeft(topLeft); | |
54 | rect.setBottomRight(bottomRight); |
|
57 | rect.setBottomRight(bottomRight); | |
55 | m_layout.append(rect.normalized()); |
|
58 | m_layout.append(rect.normalized()); | |
@@ -74,10 +77,13 QVector<QRectF> HorizontalPercentBarChartItem::calculateLayout() | |||||
74 | QRectF rect; |
|
77 | QRectF rect; | |
75 | QPointF topLeft; |
|
78 | QPointF topLeft; | |
76 | if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) |
|
79 | if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) | |
77 | topLeft = domain()->calculateGeometryPoint(QPointF(set ? 100 * sum/categorySum : domain()->minX(), category - barWidth/2)); |
|
80 | topLeft = domain()->calculateGeometryPoint(QPointF(set ? 100 * sum/categorySum : domain()->minX(), category - barWidth/2), m_validData); | |
78 | else |
|
81 | else | |
79 | topLeft = domain()->calculateGeometryPoint(QPointF(set ? 100 * sum/categorySum : 0, category - barWidth/2)); |
|
82 | topLeft = domain()->calculateGeometryPoint(QPointF(set ? 100 * sum/categorySum : 0, category - barWidth/2), m_validData); | |
80 | QPointF bottomRight = domain()->calculateGeometryPoint(QPointF(100 * (value + sum)/categorySum, category + barWidth/2)); |
|
83 | QPointF bottomRight = domain()->calculateGeometryPoint(QPointF(100 * (value + sum)/categorySum, category + barWidth/2), m_validData); | |
|
84 | ||||
|
85 | if (!m_validData) | |||
|
86 | return QVector<QRectF>(); | |||
81 | rect.setTopLeft(topLeft); |
|
87 | rect.setTopLeft(topLeft); | |
82 | rect.setBottomRight(bottomRight); |
|
88 | rect.setBottomRight(bottomRight); | |
83 | layout.append(rect.normalized()); |
|
89 | layout.append(rect.normalized()); |
@@ -43,13 +43,16 void HorizontalStackedBarChartItem::initializeLayout() | |||||
43 | QPointF topLeft; |
|
43 | QPointF topLeft; | |
44 | QPointF bottomRight; |
|
44 | QPointF bottomRight; | |
45 | if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) { |
|
45 | if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) { | |
46 | topLeft = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category - barWidth / 2)); |
|
46 | topLeft = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category - barWidth / 2), m_validData); | |
47 | bottomRight = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category + barWidth / 2)); |
|
47 | bottomRight = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category + barWidth / 2), m_validData); | |
48 | } else { |
|
48 | } else { | |
49 | topLeft = domain()->calculateGeometryPoint(QPointF(0, category - barWidth / 2)); |
|
49 | topLeft = domain()->calculateGeometryPoint(QPointF(0, category - barWidth / 2), m_validData); | |
50 | bottomRight = domain()->calculateGeometryPoint(QPointF(0, category + barWidth / 2)); |
|
50 | bottomRight = domain()->calculateGeometryPoint(QPointF(0, category + barWidth / 2), m_validData); | |
51 | } |
|
51 | } | |
52 |
|
52 | |||
|
53 | if (!m_validData) | |||
|
54 | return; | |||
|
55 | ||||
53 | rect.setTopLeft(topLeft); |
|
56 | rect.setTopLeft(topLeft); | |
54 | rect.setBottomRight(bottomRight); |
|
57 | rect.setBottomRight(bottomRight); | |
55 | m_layout.append(rect.normalized()); |
|
58 | m_layout.append(rect.normalized()); | |
@@ -75,20 +78,22 QVector<QRectF> HorizontalStackedBarChartItem::calculateLayout() | |||||
75 | QPointF topLeft; |
|
78 | QPointF topLeft; | |
76 | QPointF bottomRight; |
|
79 | QPointF bottomRight; | |
77 | if (value < 0) { |
|
80 | if (value < 0) { | |
78 | bottomRight = domain()->calculateGeometryPoint(QPointF(value + negativeSum, category - barWidth / 2)); |
|
81 | bottomRight = domain()->calculateGeometryPoint(QPointF(value + negativeSum, category - barWidth / 2), m_validData); | |
79 | if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) |
|
82 | if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) | |
80 | topLeft = domain()->calculateGeometryPoint(QPointF(set ? negativeSum : domain()->minX(), category + barWidth / 2)); |
|
83 | topLeft = domain()->calculateGeometryPoint(QPointF(set ? negativeSum : domain()->minX(), category + barWidth / 2), m_validData); | |
81 | else |
|
84 | else | |
82 | topLeft = domain()->calculateGeometryPoint(QPointF(set ? negativeSum : 0, category + barWidth / 2)); |
|
85 | topLeft = domain()->calculateGeometryPoint(QPointF(set ? negativeSum : 0, category + barWidth / 2), m_validData); | |
83 | negativeSum += value; |
|
86 | negativeSum += value; | |
84 | } else { |
|
87 | } else { | |
85 | bottomRight = domain()->calculateGeometryPoint(QPointF(value + positiveSum, category - barWidth / 2)); |
|
88 | bottomRight = domain()->calculateGeometryPoint(QPointF(value + positiveSum, category - barWidth / 2), m_validData); | |
86 | if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) |
|
89 | if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) | |
87 | topLeft = domain()->calculateGeometryPoint(QPointF(set ? positiveSum : domain()->minX(), category + barWidth / 2)); |
|
90 | topLeft = domain()->calculateGeometryPoint(QPointF(set ? positiveSum : domain()->minX(), category + barWidth / 2), m_validData); | |
88 | else |
|
91 | else | |
89 | topLeft = domain()->calculateGeometryPoint(QPointF(set ? positiveSum : 0, category + barWidth / 2)); |
|
92 | topLeft = domain()->calculateGeometryPoint(QPointF(set ? positiveSum : 0, category + barWidth / 2), m_validData); | |
90 | positiveSum += value; |
|
93 | positiveSum += value; | |
91 | } |
|
94 | } | |
|
95 | if (!m_validData) | |||
|
96 | return QVector<QRectF>(); | |||
92 | rect.setTopLeft(topLeft); |
|
97 | rect.setTopLeft(topLeft); | |
93 | rect.setBottomRight(bottomRight); |
|
98 | rect.setBottomRight(bottomRight); | |
94 | layout.append(rect.normalized()); |
|
99 | layout.append(rect.normalized()); |
@@ -45,13 +45,15 void BarChartItem::initializeLayout() | |||||
45 | QPointF bottomRight; |
|
45 | QPointF bottomRight; | |
46 |
|
46 | |||
47 | if (domain()->type() == AbstractDomain::XLogYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) { |
|
47 | if (domain()->type() == AbstractDomain::XLogYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) { | |
48 | topLeft = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2 + set/setCount * barWidth, domain()->minY())); |
|
48 | topLeft = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2 + set/setCount * barWidth, domain()->minY()), m_validData); | |
49 | bottomRight = domain()->calculateGeometryPoint(QPointF(category + barWidth / 2 + (set + 1)/setCount * barWidth, domain()->minY())); |
|
49 | bottomRight = domain()->calculateGeometryPoint(QPointF(category + barWidth / 2 + (set + 1)/setCount * barWidth, domain()->minY()), m_validData); | |
50 | } else { |
|
50 | } else { | |
51 | topLeft = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2 + set/setCount * barWidth, 0)); |
|
51 | topLeft = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2 + set/setCount * barWidth, 0), m_validData); | |
52 | bottomRight = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2 + (set + 1)/setCount * barWidth, 0)); |
|
52 | bottomRight = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2 + (set + 1)/setCount * barWidth, 0), m_validData); | |
53 | } |
|
53 | } | |
54 |
|
54 | |||
|
55 | if (!m_validData) | |||
|
56 | return; | |||
55 | rect.setTopLeft(topLeft); |
|
57 | rect.setTopLeft(topLeft); | |
56 | rect.setBottomRight(bottomRight); |
|
58 | rect.setBottomRight(bottomRight); | |
57 | m_layout.append(rect.normalized()); |
|
59 | m_layout.append(rect.normalized()); | |
@@ -72,12 +74,16 QVector<QRectF> BarChartItem::calculateLayout() | |||||
72 | for (int set = 0; set < setCount; set++) { |
|
74 | for (int set = 0; set < setCount; set++) { | |
73 | qreal value = m_series->barSets().at(set)->at(category); |
|
75 | qreal value = m_series->barSets().at(set)->at(category); | |
74 | QRectF rect; |
|
76 | QRectF rect; | |
75 | QPointF topLeft = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2 + (set)/(setCount) * barWidth, value)); |
|
77 | QPointF topLeft = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2 + (set)/(setCount) * barWidth, value), m_validData); | |
76 | QPointF bottomRight; |
|
78 | QPointF bottomRight; | |
77 | if (domain()->type() == AbstractDomain::XLogYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) |
|
79 | if (domain()->type() == AbstractDomain::XLogYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) | |
78 | bottomRight = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2 + (set + 1)/(setCount) * barWidth, domain()->minY())); |
|
80 | bottomRight = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2 + (set + 1)/(setCount) * barWidth, domain()->minY()), m_validData); | |
79 | else |
|
81 | else | |
80 | bottomRight = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2 + (set + 1)/(setCount) * barWidth, 0)); |
|
82 | bottomRight = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2 + (set + 1)/(setCount) * barWidth, 0), m_validData); | |
|
83 | ||||
|
84 | if (!m_validData) | |||
|
85 | return QVector<QRectF>(); | |||
|
86 | ||||
81 | rect.setTopLeft(topLeft); |
|
87 | rect.setTopLeft(topLeft); | |
82 | rect.setBottomRight(bottomRight); |
|
88 | rect.setBottomRight(bottomRight); | |
83 | layout.append(rect.normalized()); |
|
89 | layout.append(rect.normalized()); |
@@ -45,13 +45,16 void PercentBarChartItem::initializeLayout() | |||||
45 | QPointF bottomRight; |
|
45 | QPointF bottomRight; | |
46 |
|
46 | |||
47 | if (domain()->type() == AbstractDomain::XLogYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) { |
|
47 | if (domain()->type() == AbstractDomain::XLogYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) { | |
48 | topLeft = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2, domain()->minY())); |
|
48 | topLeft = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2, domain()->minY()), m_validData); | |
49 | bottomRight = domain()->calculateGeometryPoint(QPointF(category + barWidth / 2, domain()->minY())); |
|
49 | bottomRight = domain()->calculateGeometryPoint(QPointF(category + barWidth / 2, domain()->minY()), m_validData); | |
50 | } else { |
|
50 | } else { | |
51 | topLeft = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2, 0)); |
|
51 | topLeft = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2, 0), m_validData); | |
52 | bottomRight = domain()->calculateGeometryPoint(QPointF(category + barWidth / 2, 0)); |
|
52 | bottomRight = domain()->calculateGeometryPoint(QPointF(category + barWidth / 2, 0), m_validData); | |
53 | } |
|
53 | } | |
54 |
|
54 | |||
|
55 | if (!m_validData) | |||
|
56 | return; | |||
|
57 | ||||
55 | rect.setTopLeft(topLeft); |
|
58 | rect.setTopLeft(topLeft); | |
56 | rect.setBottomRight(bottomRight); |
|
59 | rect.setBottomRight(bottomRight); | |
57 | m_layout.append(rect.normalized()); |
|
60 | m_layout.append(rect.normalized()); | |
@@ -74,12 +77,15 QVector<QRectF> PercentBarChartItem::calculateLayout() | |||||
74 | for (int set = 0; set < setCount; set++) { |
|
77 | for (int set = 0; set < setCount; set++) { | |
75 | qreal value = m_series->barSets().at(set)->at(category); |
|
78 | qreal value = m_series->barSets().at(set)->at(category); | |
76 | QRectF rect; |
|
79 | QRectF rect; | |
77 | QPointF topLeft = domain()->calculateGeometryPoint(QPointF(category - barWidth/2, 100 * (value + sum)/categorySum)); |
|
80 | QPointF topLeft = domain()->calculateGeometryPoint(QPointF(category - barWidth/2, 100 * (value + sum)/categorySum), m_validData); | |
78 | QPointF bottomRight; |
|
81 | QPointF bottomRight; | |
79 | if (domain()->type() == AbstractDomain::XLogYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) |
|
82 | if (domain()->type() == AbstractDomain::XLogYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) | |
80 | bottomRight = domain()->calculateGeometryPoint(QPointF(category + barWidth/2, set ? 100 * sum/categorySum : domain()->minY())); |
|
83 | bottomRight = domain()->calculateGeometryPoint(QPointF(category + barWidth/2, set ? 100 * sum/categorySum : domain()->minY()), m_validData); | |
81 | else |
|
84 | else | |
82 | bottomRight = domain()->calculateGeometryPoint(QPointF(category + barWidth/2, set ? 100 * sum/categorySum : 0)); |
|
85 | bottomRight = domain()->calculateGeometryPoint(QPointF(category + barWidth/2, set ? 100 * sum/categorySum : 0), m_validData); | |
|
86 | ||||
|
87 | if (!m_validData) | |||
|
88 | return QVector<QRectF>(); | |||
83 | rect.setTopLeft(topLeft); |
|
89 | rect.setTopLeft(topLeft); | |
84 | rect.setBottomRight(bottomRight); |
|
90 | rect.setBottomRight(bottomRight); | |
85 | layout.append(rect.normalized()); |
|
91 | layout.append(rect.normalized()); |
@@ -45,13 +45,16 void StackedBarChartItem::initializeLayout() | |||||
45 | QPointF bottomRight; |
|
45 | QPointF bottomRight; | |
46 |
|
46 | |||
47 | if (domain()->type() == AbstractDomain::XLogYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) { |
|
47 | if (domain()->type() == AbstractDomain::XLogYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) { | |
48 | topLeft = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2, domain()->minY())); |
|
48 | topLeft = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2, domain()->minY()), m_validData); | |
49 | bottomRight = domain()->calculateGeometryPoint(QPointF(category + barWidth / 2, domain()->minY())); |
|
49 | bottomRight = domain()->calculateGeometryPoint(QPointF(category + barWidth / 2, domain()->minY()), m_validData); | |
50 | } else { |
|
50 | } else { | |
51 | topLeft = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2, 0)); |
|
51 | topLeft = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2, 0), m_validData); | |
52 | bottomRight = domain()->calculateGeometryPoint(QPointF(category + barWidth / 2, 0)); |
|
52 | bottomRight = domain()->calculateGeometryPoint(QPointF(category + barWidth / 2, 0), m_validData); | |
53 | } |
|
53 | } | |
54 |
|
54 | |||
|
55 | if (!m_validData) | |||
|
56 | return; | |||
|
57 | ||||
55 | rect.setTopLeft(topLeft); |
|
58 | rect.setTopLeft(topLeft); | |
56 | rect.setBottomRight(bottomRight); |
|
59 | rect.setBottomRight(bottomRight); | |
57 | m_layout.append(rect.normalized()); |
|
60 | m_layout.append(rect.normalized()); | |
@@ -76,20 +79,22 QVector<QRectF> StackedBarChartItem::calculateLayout() | |||||
76 | QPointF topLeft; |
|
79 | QPointF topLeft; | |
77 | QPointF bottomRight; |
|
80 | QPointF bottomRight; | |
78 | if (value < 0) { |
|
81 | if (value < 0) { | |
79 | bottomRight = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2, value + negativeSum)); |
|
82 | bottomRight = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2, value + negativeSum), m_validData); | |
80 | if (domain()->type() == AbstractDomain::XLogYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) |
|
83 | if (domain()->type() == AbstractDomain::XLogYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) | |
81 | topLeft = domain()->calculateGeometryPoint(QPointF(category + barWidth / 2, set ? negativeSum : domain()->minY())); |
|
84 | topLeft = domain()->calculateGeometryPoint(QPointF(category + barWidth / 2, set ? negativeSum : domain()->minY()), m_validData); | |
82 | else |
|
85 | else | |
83 | topLeft = domain()->calculateGeometryPoint(QPointF(category + barWidth / 2, set ? negativeSum : 0)); |
|
86 | topLeft = domain()->calculateGeometryPoint(QPointF(category + barWidth / 2, set ? negativeSum : 0), m_validData); | |
84 | negativeSum += value; |
|
87 | negativeSum += value; | |
85 | } else { |
|
88 | } else { | |
86 | topLeft = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2, value + positiveSum)); |
|
89 | topLeft = domain()->calculateGeometryPoint(QPointF(category - barWidth / 2, value + positiveSum), m_validData); | |
87 | if (domain()->type() == AbstractDomain::XLogYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) |
|
90 | if (domain()->type() == AbstractDomain::XLogYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) | |
88 | bottomRight = domain()->calculateGeometryPoint(QPointF(category + barWidth / 2, set ? positiveSum : domain()->minY())); |
|
91 | bottomRight = domain()->calculateGeometryPoint(QPointF(category + barWidth / 2, set ? positiveSum : domain()->minY()), m_validData); | |
89 | else |
|
92 | else | |
90 | bottomRight = domain()->calculateGeometryPoint(QPointF(category + barWidth / 2, set ? positiveSum : 0)); |
|
93 | bottomRight = domain()->calculateGeometryPoint(QPointF(category + barWidth / 2, set ? positiveSum : 0), m_validData); | |
91 | positiveSum += value; |
|
94 | positiveSum += value; | |
92 | } |
|
95 | } | |
|
96 | if (!m_validData) | |||
|
97 | return QVector<QRectF>(); | |||
93 | rect.setTopLeft(topLeft); |
|
98 | rect.setTopLeft(topLeft); | |
94 | rect.setBottomRight(bottomRight); |
|
99 | rect.setBottomRight(bottomRight); | |
95 | layout.append(rect.normalized()); |
|
100 | layout.append(rect.normalized()); |
@@ -408,8 +408,9 QPointF ChartDataSet::mapToPosition(const QPointF &value, QAbstractSeries *serie | |||||
408 | if (series && series->type() == QAbstractSeries::SeriesTypePie) |
|
408 | if (series && series->type() == QAbstractSeries::SeriesTypePie) | |
409 | return QPoint(0, 0); |
|
409 | return QPoint(0, 0); | |
410 |
|
410 | |||
|
411 | bool ok; | |||
411 | if (series && m_seriesList.contains(series)) |
|
412 | if (series && m_seriesList.contains(series)) | |
412 | point += series->d_ptr->m_domain->calculateGeometryPoint(value); |
|
413 | point += series->d_ptr->m_domain->calculateGeometryPoint(value, ok); | |
413 | return point; |
|
414 | return point; | |
414 | } |
|
415 | } | |
415 |
|
416 |
@@ -26,6 +26,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||||
26 |
|
26 | |||
27 | ChartItem::ChartItem(QAbstractSeriesPrivate *series,QGraphicsItem* item): |
|
27 | ChartItem::ChartItem(QAbstractSeriesPrivate *series,QGraphicsItem* item): | |
28 | ChartElement(item), |
|
28 | ChartElement(item), | |
|
29 | m_validData(true), | |||
29 | m_series(series) |
|
30 | m_series(series) | |
30 | { |
|
31 | { | |
31 |
|
32 |
@@ -45,6 +45,9 public: | |||||
45 | AbstractDomain* domain() const; |
|
45 | AbstractDomain* domain() const; | |
46 | public Q_SLOTS: |
|
46 | public Q_SLOTS: | |
47 | virtual void handleDomainUpdated(); |
|
47 | virtual void handleDomainUpdated(); | |
|
48 | ||||
|
49 | protected: | |||
|
50 | bool m_validData; | |||
48 | private: |
|
51 | private: | |
49 | QAbstractSeriesPrivate* m_series; |
|
52 | QAbstractSeriesPrivate* m_series; | |
50 | }; |
|
53 | }; |
@@ -80,7 +80,7 public: | |||||
80 | virtual void zoomOut(const QRectF &rect) = 0; |
|
80 | virtual void zoomOut(const QRectF &rect) = 0; | |
81 | virtual void move(qreal dx, qreal dy) = 0; |
|
81 | virtual void move(qreal dx, qreal dy) = 0; | |
82 |
|
82 | |||
83 | virtual QPointF calculateGeometryPoint(const QPointF &point) const = 0; |
|
83 | virtual QPointF calculateGeometryPoint(const QPointF &point, bool &ok) const = 0; | |
84 | virtual QPointF calculateDomainPoint(const QPointF &point) const = 0; |
|
84 | virtual QPointF calculateDomainPoint(const QPointF &point) const = 0; | |
85 | virtual QVector<QPointF> calculateGeometryPoints(const QList<QPointF>& vector) const = 0; |
|
85 | virtual QVector<QPointF> calculateGeometryPoints(const QList<QPointF>& vector) const = 0; | |
86 |
|
86 |
@@ -131,13 +131,20 void LogXLogYDomain::move(qreal dx, qreal dy) | |||||
131 | setRange(minX, maxX, minY, maxY); |
|
131 | setRange(minX, maxX, minY, maxY); | |
132 | } |
|
132 | } | |
133 |
|
133 | |||
134 | QPointF LogXLogYDomain::calculateGeometryPoint(const QPointF &point) const |
|
134 | QPointF LogXLogYDomain::calculateGeometryPoint(const QPointF &point, bool &ok) const | |
135 | { |
|
135 | { | |
|
136 | if (point.x() > 0 && point.y() > 0) { | |||
136 | const qreal deltaX = m_size.width() / qAbs(m_logRightX - m_logLeftX); |
|
137 | const qreal deltaX = m_size.width() / qAbs(m_logRightX - m_logLeftX); | |
137 | const qreal deltaY = m_size.height() / qAbs(m_logRightY - m_logLeftY); |
|
138 | const qreal deltaY = m_size.height() / qAbs(m_logRightY - m_logLeftY); | |
138 | qreal x = (log10(point.x()) / log10(m_logBaseX)) * deltaX - m_logLeftX * deltaX; |
|
139 | qreal x = (log10(point.x()) / log10(m_logBaseX)) * deltaX - m_logLeftX * deltaX; | |
139 | qreal y = (log10(point.y()) / log10(m_logBaseY)) * -deltaY - m_logLeftY * -deltaY + m_size.height(); |
|
140 | qreal y = (log10(point.y()) / log10(m_logBaseY)) * -deltaY - m_logLeftY * -deltaY + m_size.height(); | |
|
141 | ok = true; | |||
140 | return QPointF(x, y); |
|
142 | return QPointF(x, y); | |
|
143 | } else { | |||
|
144 | qWarning() << "Logarithm of negative value is undefined. Empty layout returned"; | |||
|
145 | ok = false; | |||
|
146 | return QPointF(); | |||
|
147 | } | |||
141 | } |
|
148 | } | |
142 |
|
149 | |||
143 | QVector<QPointF> LogXLogYDomain::calculateGeometryPoints(const QList<QPointF>& vector) const |
|
150 | QVector<QPointF> LogXLogYDomain::calculateGeometryPoints(const QList<QPointF>& vector) const | |
@@ -149,10 +156,15 QVector<QPointF> LogXLogYDomain::calculateGeometryPoints(const QList<QPointF>& v | |||||
149 | result.resize(vector.count()); |
|
156 | result.resize(vector.count()); | |
150 |
|
157 | |||
151 | for (int i = 0; i < vector.count(); ++i) { |
|
158 | for (int i = 0; i < vector.count(); ++i) { | |
|
159 | if (vector[i].x() > 0 && vector[i].y() > 0) { | |||
152 | qreal x = (log10(vector[i].x()) / log10(m_logBaseX)) * deltaX - m_logLeftX * deltaX; |
|
160 | qreal x = (log10(vector[i].x()) / log10(m_logBaseX)) * deltaX - m_logLeftX * deltaX; | |
153 | qreal y = (log10(vector[i].y()) / log10(m_logBaseY)) * -deltaY - m_logLeftY * -deltaY + m_size.height(); |
|
161 | qreal y = (log10(vector[i].y()) / log10(m_logBaseY)) * -deltaY - m_logLeftY * -deltaY + m_size.height(); | |
154 | result[i].setX(x); |
|
162 | result[i].setX(x); | |
155 | result[i].setY(y); |
|
163 | result[i].setY(y); | |
|
164 | } else { | |||
|
165 | qWarning() << "Logarithm of negative value is undefined. Empty layout returned"; | |||
|
166 | return QVector<QPointF>(); | |||
|
167 | } | |||
156 | } |
|
168 | } | |
157 | return result; |
|
169 | return result; | |
158 | } |
|
170 | } |
@@ -54,7 +54,7 public: | |||||
54 | void zoomOut(const QRectF &rect); |
|
54 | void zoomOut(const QRectF &rect); | |
55 | void move(qreal dx, qreal dy); |
|
55 | void move(qreal dx, qreal dy); | |
56 |
|
56 | |||
57 | QPointF calculateGeometryPoint(const QPointF &point) const; |
|
57 | QPointF calculateGeometryPoint(const QPointF &point, bool &ok) const; | |
58 | QPointF calculateDomainPoint(const QPointF &point) const; |
|
58 | QPointF calculateDomainPoint(const QPointF &point) const; | |
59 | QVector<QPointF> calculateGeometryPoints(const QList<QPointF>& vector) const; |
|
59 | QVector<QPointF> calculateGeometryPoints(const QList<QPointF>& vector) const; | |
60 |
|
60 |
@@ -125,14 +125,22 void LogXYDomain::move(qreal dx, qreal dy) | |||||
125 | setRange(minX, maxX, minY, maxY); |
|
125 | setRange(minX, maxX, minY, maxY); | |
126 | } |
|
126 | } | |
127 |
|
127 | |||
128 | QPointF LogXYDomain::calculateGeometryPoint(const QPointF &point) const |
|
128 | QPointF LogXYDomain::calculateGeometryPoint(const QPointF &point, bool &ok) const | |
129 | { |
|
129 | { | |
|
130 | ||||
|
131 | if (point.x() > 0) { | |||
130 | const qreal deltaX = m_size.width() / (m_logRightX - m_logLeftX); |
|
132 | const qreal deltaX = m_size.width() / (m_logRightX - m_logLeftX); | |
131 | const qreal deltaY = m_size.height() / (m_maxY - m_minY); |
|
133 | const qreal deltaY = m_size.height() / (m_maxY - m_minY); | |
132 |
|
134 | |||
133 | qreal x = (log10(point.x()) / log10(m_logBaseX)) * deltaX - m_logLeftX * deltaX; |
|
135 | qreal x = (log10(point.x()) / log10(m_logBaseX)) * deltaX - m_logLeftX * deltaX; | |
134 | qreal y = (point.y() - m_minY) * -deltaY + m_size.height(); |
|
136 | qreal y = (point.y() - m_minY) * -deltaY + m_size.height(); | |
|
137 | ok = true; | |||
135 | return QPointF(x, y); |
|
138 | return QPointF(x, y); | |
|
139 | } else { | |||
|
140 | qWarning() << "Logarithm of negative value is undefined. Empty layout returned"; | |||
|
141 | ok = false; | |||
|
142 | return QPointF(); | |||
|
143 | } | |||
136 | } |
|
144 | } | |
137 |
|
145 | |||
138 | QVector<QPointF> LogXYDomain::calculateGeometryPoints(const QList<QPointF>& vector) const |
|
146 | QVector<QPointF> LogXYDomain::calculateGeometryPoints(const QList<QPointF>& vector) const | |
@@ -144,10 +152,15 QVector<QPointF> LogXYDomain::calculateGeometryPoints(const QList<QPointF>& vect | |||||
144 | result.resize(vector.count()); |
|
152 | result.resize(vector.count()); | |
145 |
|
153 | |||
146 | for (int i = 0; i < vector.count(); ++i) { |
|
154 | for (int i = 0; i < vector.count(); ++i) { | |
|
155 | if (vector[i].x() > 0) { | |||
147 | qreal x = (log10(vector[i].x()) / log10(m_logBaseX)) * deltaX - m_logLeftX * deltaX; |
|
156 | qreal x = (log10(vector[i].x()) / log10(m_logBaseX)) * deltaX - m_logLeftX * deltaX; | |
148 | qreal y = (vector[i].y() - m_minY) * -deltaY + m_size.height(); |
|
157 | qreal y = (vector[i].y() - m_minY) * -deltaY + m_size.height(); | |
149 | result[i].setX(x); |
|
158 | result[i].setX(x); | |
150 | result[i].setY(y); |
|
159 | result[i].setY(y); | |
|
160 | } else { | |||
|
161 | qWarning() << "Logarithm of negative value is undefined. Empty layout returned"; | |||
|
162 | return QVector<QPointF>(); | |||
|
163 | } | |||
151 | } |
|
164 | } | |
152 | return result; |
|
165 | return result; | |
153 | } |
|
166 | } |
@@ -54,7 +54,7 public: | |||||
54 | void zoomOut(const QRectF &rect); |
|
54 | void zoomOut(const QRectF &rect); | |
55 | void move(qreal dx, qreal dy); |
|
55 | void move(qreal dx, qreal dy); | |
56 |
|
56 | |||
57 | QPointF calculateGeometryPoint(const QPointF &point) const; |
|
57 | QPointF calculateGeometryPoint(const QPointF &point, bool &ok) const; | |
58 | QPointF calculateDomainPoint(const QPointF &point) const; |
|
58 | QPointF calculateDomainPoint(const QPointF &point) const; | |
59 | QVector<QPointF> calculateGeometryPoints(const QList<QPointF>& vector) const; |
|
59 | QVector<QPointF> calculateGeometryPoints(const QList<QPointF>& vector) const; | |
60 |
|
60 |
@@ -125,14 +125,21 void XLogYDomain::move(qreal dx, qreal dy) | |||||
125 | setRange(minX, maxX, minY, maxY); |
|
125 | setRange(minX, maxX, minY, maxY); | |
126 | } |
|
126 | } | |
127 |
|
127 | |||
128 | QPointF XLogYDomain::calculateGeometryPoint(const QPointF &point) const |
|
128 | QPointF XLogYDomain::calculateGeometryPoint(const QPointF &point, bool &ok) const | |
129 | { |
|
129 | { | |
|
130 | if (point.y() > 0) { | |||
130 | const qreal deltaX = m_size.width() / (m_maxX - m_minX); |
|
131 | const qreal deltaX = m_size.width() / (m_maxX - m_minX); | |
131 | const qreal deltaY = m_size.height() / qAbs(m_logRightY - m_logLeftY); |
|
132 | const qreal deltaY = m_size.height() / qAbs(m_logRightY - m_logLeftY); | |
132 |
|
133 | |||
133 | qreal x = (point.x() - m_minX) * deltaX; |
|
134 | qreal x = (point.x() - m_minX) * deltaX; | |
134 | qreal y = (log10(point.y()) / log10(m_logBaseY)) * -deltaY - m_logLeftY * -deltaY + m_size.height(); |
|
135 | qreal y = (log10(point.y()) / log10(m_logBaseY)) * -deltaY - m_logLeftY * -deltaY + m_size.height(); | |
|
136 | ok = true; | |||
135 | return QPointF(x, y); |
|
137 | return QPointF(x, y); | |
|
138 | } else { | |||
|
139 | qWarning() << "Logarithm of negative value is undefined. Empty layout returned"; | |||
|
140 | ok = false; | |||
|
141 | return QPointF(); | |||
|
142 | } | |||
136 | } |
|
143 | } | |
137 |
|
144 | |||
138 | QVector<QPointF> XLogYDomain::calculateGeometryPoints(const QList<QPointF>& vector) const |
|
145 | QVector<QPointF> XLogYDomain::calculateGeometryPoints(const QList<QPointF>& vector) const | |
@@ -144,10 +151,15 QVector<QPointF> XLogYDomain::calculateGeometryPoints(const QList<QPointF>& vect | |||||
144 | result.resize(vector.count()); |
|
151 | result.resize(vector.count()); | |
145 |
|
152 | |||
146 | for (int i = 0; i < vector.count(); ++i) { |
|
153 | for (int i = 0; i < vector.count(); ++i) { | |
|
154 | if (vector[i].y() > 0) { | |||
147 | qreal x = (vector[i].x() - m_minX) * deltaX; |
|
155 | qreal x = (vector[i].x() - m_minX) * deltaX; | |
148 | qreal y = (log10(vector[i].y()) / log10(m_logBaseY)) * -deltaY - m_logLeftY * -deltaY + m_size.height(); |
|
156 | qreal y = (log10(vector[i].y()) / log10(m_logBaseY)) * -deltaY - m_logLeftY * -deltaY + m_size.height(); | |
149 | result[i].setX(x); |
|
157 | result[i].setX(x); | |
150 | result[i].setY(y); |
|
158 | result[i].setY(y); | |
|
159 | } else { | |||
|
160 | qWarning() << "Logarithm of negative value is undefined. Empty layout returned"; | |||
|
161 | return QVector<QPointF>(); | |||
|
162 | } | |||
151 | } |
|
163 | } | |
152 | return result; |
|
164 | return result; | |
153 | } |
|
165 | } |
@@ -54,7 +54,7 public: | |||||
54 | void zoomOut(const QRectF &rect); |
|
54 | void zoomOut(const QRectF &rect); | |
55 | void move(qreal dx, qreal dy); |
|
55 | void move(qreal dx, qreal dy); | |
56 |
|
56 | |||
57 | QPointF calculateGeometryPoint(const QPointF &point) const; |
|
57 | QPointF calculateGeometryPoint(const QPointF &point, bool &ok) const; | |
58 | QPointF calculateDomainPoint(const QPointF &point) const; |
|
58 | QPointF calculateDomainPoint(const QPointF &point) const; | |
59 | QVector<QPointF> calculateGeometryPoints(const QList<QPointF>& vector) const; |
|
59 | QVector<QPointF> calculateGeometryPoints(const QList<QPointF>& vector) const; | |
60 |
|
60 |
@@ -116,12 +116,13 void XYDomain::move(qreal dx, qreal dy) | |||||
116 | setRange(minX, maxX, minY, maxY); |
|
116 | setRange(minX, maxX, minY, maxY); | |
117 | } |
|
117 | } | |
118 |
|
118 | |||
119 | QPointF XYDomain::calculateGeometryPoint(const QPointF &point) const |
|
119 | QPointF XYDomain::calculateGeometryPoint(const QPointF &point, bool &ok) const | |
120 | { |
|
120 | { | |
121 | const qreal deltaX = m_size.width() / (m_maxX - m_minX); |
|
121 | const qreal deltaX = m_size.width() / (m_maxX - m_minX); | |
122 | const qreal deltaY = m_size.height() / (m_maxY - m_minY); |
|
122 | const qreal deltaY = m_size.height() / (m_maxY - m_minY); | |
123 | qreal x = (point.x() - m_minX) * deltaX; |
|
123 | qreal x = (point.x() - m_minX) * deltaX; | |
124 | qreal y = (point.y() - m_minY) * -deltaY + m_size.height(); |
|
124 | qreal y = (point.y() - m_minY) * -deltaY + m_size.height(); | |
|
125 | ok = true; | |||
125 | return QPointF(x, y); |
|
126 | return QPointF(x, y); | |
126 | } |
|
127 | } | |
127 |
|
128 |
@@ -54,7 +54,7 public: | |||||
54 | void zoomOut(const QRectF &rect); |
|
54 | void zoomOut(const QRectF &rect); | |
55 | void move(qreal dx, qreal dy); |
|
55 | void move(qreal dx, qreal dy); | |
56 |
|
56 | |||
57 | QPointF calculateGeometryPoint(const QPointF &point) const; |
|
57 | QPointF calculateGeometryPoint(const QPointF &point, bool &ok) const; | |
58 | QPointF calculateDomainPoint(const QPointF &point) const; |
|
58 | QPointF calculateDomainPoint(const QPointF &point) const; | |
59 | QVector<QPointF> calculateGeometryPoints(const QList<QPointF>& vector) const; |
|
59 | QVector<QPointF> calculateGeometryPoints(const QList<QPointF>& vector) const; | |
60 | }; |
|
60 | }; |
@@ -135,15 +135,15 void LineChartItem::mousePressEvent(QGraphicsSceneMouseEvent *event) | |||||
135 | void LineChartItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) |
|
135 | void LineChartItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) | |
136 | { |
|
136 | { | |
137 | emit XYChart::hovered(domain()->calculateDomainPoint(event->pos()), true); |
|
137 | emit XYChart::hovered(domain()->calculateDomainPoint(event->pos()), true); | |
138 | event->accept(); |
|
138 | // event->accept(); | |
139 |
|
|
139 | QGraphicsItem::hoverEnterEvent(event); | |
140 | } |
|
140 | } | |
141 |
|
141 | |||
142 | void LineChartItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) |
|
142 | void LineChartItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) | |
143 | { |
|
143 | { | |
144 | emit XYChart::hovered(domain()->calculateDomainPoint(event->pos()), false); |
|
144 | emit XYChart::hovered(domain()->calculateDomainPoint(event->pos()), false); | |
145 | event->accept(); |
|
145 | // event->accept(); | |
146 |
|
|
146 | QGraphicsItem::hoverEnterEvent(event); | |
147 | } |
|
147 | } | |
148 |
|
148 | |||
149 | #include "moc_linechartitem_p.cpp" |
|
149 | #include "moc_linechartitem_p.cpp" |
@@ -101,7 +101,8 void SplineChartItem::updateChart(QVector<QPointF> &oldPoints, QVector<QPointF> | |||||
101 |
|
101 | |||
102 | QPointF SplineChartItem::calculateGeometryControlPoint(int index) const |
|
102 | QPointF SplineChartItem::calculateGeometryControlPoint(int index) const | |
103 | { |
|
103 | { | |
104 | return domain()->calculateGeometryPoint(m_series->d_func()->controlPoint(index)); |
|
104 | bool ok; | |
|
105 | return domain()->calculateGeometryPoint(m_series->d_func()->controlPoint(index), ok); | |||
105 | } |
|
106 | } | |
106 |
|
107 | |||
107 | void SplineChartItem::updateGeometry() |
|
108 | void SplineChartItem::updateGeometry() | |
@@ -176,13 +177,13 void SplineChartItem::mousePressEvent(QGraphicsSceneMouseEvent *event) | |||||
176 | void SplineChartItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) |
|
177 | void SplineChartItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) | |
177 | { |
|
178 | { | |
178 | emit XYChart::hovered(domain()->calculateDomainPoint(event->pos()), true); |
|
179 | emit XYChart::hovered(domain()->calculateDomainPoint(event->pos()), true); | |
179 | event->accept(); |
|
180 | QGraphicsItem::hoverEnterEvent(event); | |
180 | } |
|
181 | } | |
181 |
|
182 | |||
182 | void SplineChartItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) |
|
183 | void SplineChartItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) | |
183 | { |
|
184 | { | |
184 | emit XYChart::hovered(domain()->calculateDomainPoint(event->pos()), false); |
|
185 | emit XYChart::hovered(domain()->calculateDomainPoint(event->pos()), false); | |
185 | event->accept(); |
|
186 | QGraphicsItem::hoverLeaveEvent(event); | |
186 | } |
|
187 | } | |
187 |
|
188 | |||
188 | #include "moc_splinechartitem_p.cpp" |
|
189 | #include "moc_splinechartitem_p.cpp" |
@@ -88,7 +88,11 void XYChart::handlePointAdded(int index) | |||||
88 | points = domain()->calculateGeometryPoints(m_series->points()); |
|
88 | points = domain()->calculateGeometryPoints(m_series->points()); | |
89 | } else { |
|
89 | } else { | |
90 | points = m_points; |
|
90 | points = m_points; | |
91 | QPointF point = domain()->calculateGeometryPoint(m_series->points()[index]); |
|
91 | QPointF point = domain()->calculateGeometryPoint(m_series->points()[index], m_validData); | |
|
92 | if (!m_validData) { | |||
|
93 | m_points.clear(); | |||
|
94 | return; | |||
|
95 | } | |||
92 | points.insert(index, point); |
|
96 | points.insert(index, point); | |
93 | } |
|
97 | } | |
94 |
|
98 | |||
@@ -122,7 +126,11 void XYChart::handlePointReplaced(int index) | |||||
122 | if (m_dirty) { |
|
126 | if (m_dirty) { | |
123 | points = domain()->calculateGeometryPoints(m_series->points()); |
|
127 | points = domain()->calculateGeometryPoints(m_series->points()); | |
124 | } else { |
|
128 | } else { | |
125 | QPointF point = domain()->calculateGeometryPoint(m_series->points()[index]); |
|
129 | QPointF point = domain()->calculateGeometryPoint(m_series->points()[index], m_validData); | |
|
130 | if (!m_validData) { | |||
|
131 | m_points.clear(); | |||
|
132 | return; | |||
|
133 | } | |||
126 | points = m_points; |
|
134 | points = m_points; | |
127 | points.replace(index, point); |
|
135 | points.replace(index, point); | |
128 | } |
|
136 | } |
General Comments 0
You need to be logged in to leave comments.
Login now