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() ...@@ -144,5 +144,18 @@ void RatioSetAggregator::updateSingularChart()
mapper->setLabelsRow(1); mapper->setLabelsRow(1);
mapper->setSeries(series); mapper->setSeries(series);
decoratePieSeries(series);
QObject::connect(series, &QPieSeries::added, [this, series]() {
decoratePieSeries(series);
});
m_singularChart->addSeries(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 @@ ...@@ -22,6 +22,10 @@
#include <memory> #include <memory>
namespace QtCharts {
class QPieSeries;
}
namespace UserFeedback { namespace UserFeedback {
namespace Console { namespace Console {
...@@ -42,6 +46,8 @@ private: ...@@ -42,6 +46,8 @@ private:
void updateTimelineChart(); void updateTimelineChart();
void updateSingularChart(); void updateSingularChart();
void decoratePieSeries(QtCharts::QPieSeries *series) const;
std::unique_ptr<RatioSetAggregationModel> m_model; std::unique_ptr<RatioSetAggregationModel> m_model;
std::unique_ptr<QtCharts::QChart> m_timelineChart; std::unique_ptr<QtCharts::QChart> m_timelineChart;
std::unique_ptr<QtCharts::QChart> m_singularChart; 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