Add horizontal legend

This commit is contained in:
Emil Sawicki
2022-02-07 23:16:07 +01:00
parent 667ff4adb4
commit b14f0be7bc
4 changed files with 325 additions and 90 deletions

View File

@@ -91,6 +91,7 @@ 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;
@@ -143,7 +144,7 @@ void PieChart::paintChartLegend(QPainter *painter, QRectF legendRect)
}
}
QSizeF PieChart::calcChartLegendSize(const QFont &font)
QSizeF PieChart::calcChartLegendSize(const QFont &font, qreal)
{
QFontMetrics fm(font);

View File

@@ -8,7 +8,7 @@ namespace LimeReport{
class PieChart : public AbstractChart{
public:
PieChart(ChartItem* chartItem):AbstractChart(chartItem){}
QSizeF calcChartLegendSize(const QFont &font);
QSizeF calcChartLegendSize(const QFont &font, qreal maxWidth = 0);
void paintChart(QPainter *painter, QRectF chartRect);
void paintChartLegend(QPainter *painter, QRectF legendRect);
protected: