Don't use simple labels as they may overlap

Instead, use labels that are rendered outside of the chart and 'linked'
with the corresponding pie chart piece via a thin line.
This commit is contained in:
2019-07-18 12:01:52 +02:00
parent 56d9bed152
commit 20bc97412c

View File

@@ -35,7 +35,6 @@ public class AccountGroupExpensesGenerator extends AbstractChartGenerator<Accoun
final NumberFormat percentInstance = NumberFormat.getPercentInstance(LocaleContextHolder.getLocale()); final NumberFormat percentInstance = NumberFormat.getPercentInstance(LocaleContextHolder.getLocale());
final PiePlot plot = (PiePlot) chart.getPlot(); final PiePlot plot = (PiePlot) chart.getPlot();
plot.setSimpleLabels(true);
plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0}: {1} ({2})", currencyInstance, percentInstance)); plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0}: {1} ({2})", currencyInstance, percentInstance));
return chart; return chart;