##// END OF EJS Templates
barchart domain fix
sauimone -
r674:2c12358822ee
parent child
Show More
@@ -110,6 +110,12 void BarChartItem::layoutChanged()
110 110 qreal tW = mWidth;
111 111 qreal tH = mHeight;
112 112 qreal tM = mSeries->max();
113
114 // Domain:
115 if (mDomainMaxY > tM) {
116 tM = mDomainMaxY;
117 }
118
113 119 qreal scale = (tH/tM);
114 120 qreal tC = categoryCount + 1;
115 121 qreal categoryWidth = tW/tC;
@@ -222,11 +228,11 void BarChartItem::handleModelChanged(int index)
222 228
223 229 void BarChartItem::handleDomainChanged(qreal minX, qreal maxX, qreal minY, qreal maxY)
224 230 {
225 // TODO:
226 Q_UNUSED(minX)
227 Q_UNUSED(maxX)
228 Q_UNUSED(minY)
229 Q_UNUSED(maxY)
231 mDomainMinX = minX;
232 mDomainMaxX = maxX;
233 mDomainMinY = minY;
234 mDomainMaxY = maxY;
235 layoutChanged();
230 236
231 237 /*
232 238 int count = mSeries->categoryCount();
@@ -57,6 +57,11 protected:
57 57 int mWidth;
58 58 qreal mBarWidth;
59 59
60 qreal mDomainMinX;
61 qreal mDomainMaxX;
62 qreal mDomainMinY;
63 qreal mDomainMaxY;
64
60 65 bool mLayoutSet; // True, if component has been laid out.
61 66
62 67 // Not owned.
@@ -39,6 +39,11 void StackedBarChartItem::layoutChanged()
39 39
40 40 // Use temporary qreals for accurancy (we might get some compiler warnings... :)
41 41 qreal maxSum = mSeries->maxCategorySum();
42 // Domain:
43 if (mDomainMaxY > maxSum) {
44 maxSum = mDomainMaxY;
45 }
46
42 47 qreal h = mHeight;
43 48 qreal scale = (h / maxSum);
44 49 qreal tW = mWidth;
General Comments 0
You need to be logged in to leave comments. Login now