Commit 36c685e9 authored by Volker Krause's avatar Volker Krause
Browse files

Add labels to the singular ratio set chart too

parent 13bac488
......@@ -144,5 +144,18 @@ void RatioSetAggregator::updateSingularChart()
mapper->setLabelsRow(1);
mapper->setSeries(series);
decoratePieSeries(series);
QObject::connect(series, &QPieSeries::added, [this, series]() {
decoratePieSeries(series);
});
m_singularChart->addSeries(series);
}
void RatioSetAggregator::decoratePieSeries(QtCharts::QPieSeries *series) const
{
for (auto slice : series->slices()) {
if (slice->value() > 0.0)
slice->setLabelVisible(true);
}
}
......@@ -22,6 +22,10 @@
#include <memory>
namespace QtCharts {
class QPieSeries;
}
namespace UserFeedback {
namespace Console {
......@@ -42,6 +46,8 @@ private:
void updateTimelineChart();
void updateSingularChart();
void decoratePieSeries(QtCharts::QPieSeries *series) const;
std::unique_ptr<RatioSetAggregationModel> m_model;
std::unique_ptr<QtCharts::QChart> m_timelineChart;
std::unique_ptr<QtCharts::QChart> m_singularChart;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment