Commit 9b2957ba authored by Volker Krause's avatar Volker Krause
Browse files

Show labels in singular category charts

parent 1310e661
......@@ -147,5 +147,18 @@ void CategoryAggregator::updateSingularChart()
mapper->setLabelsRow(1);
mapper->setSeries(series);
decorateSeries(series);
QObject::connect(series, &QPieSeries::added, [this, series]() {
decorateSeries(series);
});
m_singularChart->addSeries(series);
}
void CategoryAggregator::decorateSeries(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 {
......@@ -41,6 +45,7 @@ public:
private:
void updateTimelineChart();
void updateSingularChart();
void decorateSeries(QtCharts::QPieSeries *series) const;
std::unique_ptr<CategoryAggregationModel> m_model;
std::unique_ptr<QtCharts::QChart> m_timelineChart;
......
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