statistics: render bar and pie labels onto fill color

The labels in bar an pie charts are realized as individual
QSG pixmap nodes with an alpha channel. Sadly, rendering
bright labels onto a transparent background gives very
ugly artifacts.

As a stop gap measure, until the problem is understood,
render on a background with the color of the pie slice
or bar.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-01-19 16:09:56 +01:00 committed by bstoeger
parent 2e2019dea7
commit 4f58e9aa62
5 changed files with 29 additions and 19 deletions

View file

@ -65,11 +65,11 @@ void PieSeries::Item::updatePositions(const QPointF &center, double radius)
void PieSeries::Item::highlight(ChartPieItem &item, int bin_nr, bool highlight, int numBins)
{
QColor fill = highlight ? highlightedColor : binColor(bin_nr, numBins);
QColor border = highlight ? highlightedBorderColor : ::borderColor;
if (innerLabel)
innerLabel->setColor(highlight ? darkLabelColor : labelColor(bin_nr, numBins));
item.drawSegment(angleFrom, angleTo,
highlight ? highlightedColor : binColor(bin_nr, numBins),
highlight ? highlightedBorderColor : ::borderColor);
innerLabel->setColor(highlight ? darkLabelColor : labelColor(bin_nr, numBins), fill);
item.drawSegment(angleFrom, angleTo, fill, border);
}
PieSeries::PieSeries(StatsView &view, StatsAxis *xAxis, StatsAxis *yAxis, const QString &categoryName,