diff --git a/src/barchart/barchartitem.cpp b/src/barchart/barchartitem.cpp index 25d53c9..c75555b 100644 --- a/src/barchart/barchartitem.cpp +++ b/src/barchart/barchartitem.cpp @@ -116,7 +116,7 @@ QVector BarChartItem::calculateLayout() qreal scaleY = (height / rangeY); qreal scaleX = (width / rangeX); qreal categoryWidth = width / categoryCount; - qreal barWidth = categoryWidth - categoryWidth * m_series->d_func()->barMargin(); + qreal barWidth = categoryWidth / setCount - categoryWidth * m_series->d_func()->barMargin(); int itemIndex(0); for (int category = 0; category < categoryCount; category++) {