diff --git a/limereport/items/charts/lrpiechart.cpp b/limereport/items/charts/lrpiechart.cpp index 1f61190..dbc7687 100644 --- a/limereport/items/charts/lrpiechart.cpp +++ b/limereport/items/charts/lrpiechart.cpp @@ -91,7 +91,6 @@ void PieChart::paintChart(QPainter *painter, QRectF chartRect) void PieChart::paintChartLegend(QPainter *painter, QRectF legendRect) { -// TODO_ES Fix bottom legend when axis is at the bottom prepareLegendToPaint(legendRect, painter); int indicatorSize = painter->fontMetrics().height()/2; diff --git a/limereport/items/lrchartitem.cpp b/limereport/items/lrchartitem.cpp index 3746a50..fa3b6ed 100644 --- a/limereport/items/lrchartitem.cpp +++ b/limereport/items/lrchartitem.cpp @@ -197,28 +197,25 @@ void ChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, const QRectF titleRect = QRectF(borderMargin,borderMargin,rect().width()-borderMargin*2,titleOffset); QRectF legendRect = QRectF(0, 0, 0, 0); - QRectF diagramRect = QRectF(0, 0, 0, 0); + QRectF diagramRect = rect().adjusted(borderMargin, titleOffset + borderMargin, + -(borderMargin * 2), -borderMargin); if (m_showLegend) { legendRect = m_chart->calcChartLegendRect(painter->font(), rect(), false, borderMargin, titleOffset); switch(legendAlign()) { case LegendAlignRightTop: case LegendAlignRightBottom: case LegendAlignRightCenter: - diagramRect = rect().adjusted(borderMargin, titleOffset + borderMargin, - -(legendRect.width() + borderMargin * 2), -borderMargin); + diagramRect.adjust(0, 0, -legendRect.width(), 0); break; case LegendAlignBottomLeft: case LegendAlignBottomCenter: case LegendAlignBottomRight: - diagramRect = rect().adjusted(borderMargin, titleOffset + borderMargin, - (borderMargin * 2), -legendRect.height()); + diagramRect.adjust(0, 0, 0, -(legendRect.height() + borderMargin * 2)); break; } - } else { - diagramRect = rect().adjusted(borderMargin, titleOffset + borderMargin, - -(borderMargin * 2), -borderMargin); } + painter->fillRect(diagramRect, Qt::yellow); paintChartTitle(painter, titleRect); if (m_showLegend) m_chart->paintChartLegend(painter,legendRect);