##// END OF EJS Templates
barseries bar scaling change
sauimone -
r1326:dacdfd6d84ab
parent child
Show More
@@ -111,8 +111,7 QVector<QRectF> BarChartItem::calculateLayout()
111 qreal rangeX = m_domainMaxX - m_domainMinX;
111 qreal rangeX = m_domainMaxX - m_domainMinX;
112 qreal scaleY = (height / rangeY);
112 qreal scaleY = (height / rangeY);
113 qreal scaleX = (width / rangeX);
113 qreal scaleX = (width / rangeX);
114 qreal categoryWidth = width / categoryCount;
114 qreal barWidth = scaleX - scaleX * m_series->d_func()->barMargin();
115 qreal barWidth = categoryWidth - categoryWidth * m_series->d_func()->barMargin();
116
115
117 int itemIndex(0);
116 int itemIndex(0);
118 for (int category = 0; category < categoryCount; category++) {
117 for (int category = 0; category < categoryCount; category++) {
@@ -47,8 +47,7 QVector<QRectF> GroupedBarChartItem::calculateLayout()
47 qreal rangeX = m_domainMaxX - m_domainMinX;
47 qreal rangeX = m_domainMaxX - m_domainMinX;
48 qreal scaleY = (height / rangeY);
48 qreal scaleY = (height / rangeY);
49 qreal scaleX = (width / rangeX);
49 qreal scaleX = (width / rangeX);
50 qreal categoryWidth = width / categoryCount;
50 qreal barWidth = scaleX / setCount - (scaleX / setCount) * m_series->d_func()->barMargin();
51 qreal barWidth = categoryWidth / setCount - (categoryWidth / setCount) * m_series->d_func()->barMargin();
52
51
53 int itemIndex(0);
52 int itemIndex(0);
54 for (int category = 0; category < categoryCount; category++) {
53 for (int category = 0; category < categoryCount; category++) {
@@ -47,8 +47,7 QVector<QRectF> PercentBarChartItem::calculateLayout()
47 qreal rangeX = m_domainMaxX - m_domainMinX;
47 qreal rangeX = m_domainMaxX - m_domainMinX;
48 qreal scaleY = (height / rangeY);
48 qreal scaleY = (height / rangeY);
49 qreal scaleX = (width / rangeX);
49 qreal scaleX = (width / rangeX);
50 qreal categoryWidth = width / categoryCount;
50 qreal barWidth = scaleX - scaleX * m_series->d_func()->barMargin();
51 qreal barWidth = categoryWidth - categoryWidth * m_series->d_func()->barMargin();
52
51
53 int itemIndex(0);
52 int itemIndex(0);
54 for (int category = 0; category < categoryCount; category++) {
53 for (int category = 0; category < categoryCount; category++) {
@@ -46,8 +46,7 QVector<QRectF> StackedBarChartItem::calculateLayout()
46 qreal rangeX = m_domainMaxX - m_domainMinX;
46 qreal rangeX = m_domainMaxX - m_domainMinX;
47 qreal scaleY = (height / rangeY);
47 qreal scaleY = (height / rangeY);
48 qreal scaleX = (width / rangeX);
48 qreal scaleX = (width / rangeX);
49 qreal categoryWidth = width / categoryCount;
49 qreal barWidth = scaleX - scaleX * m_series->d_func()->barMargin();
50 qreal barWidth = categoryWidth - categoryWidth * m_series->d_func()->barMargin();
51
50
52 int itemIndex(0);
51 int itemIndex(0);
53 for (int category = 0; category < categoryCount; category++) {
52 for (int category = 0; category < categoryCount; category++) {
General Comments 0
You need to be logged in to leave comments. Login now