Hi Himanshu,
thanks for the quick response to center the charts. Great!
In my application, I cannot just work with strings and doubles for pie charts. The labels are entered by the user and therefore I cannot use them as identifiers. Therefore I am looking for example to work with the data model directly.
This is my current code snippet:
----8<----------------
ICircularSeries<?> circularSeries = (ICircularSeries<?>) chart.getSeriesSet().createSeries(SeriesType.DOUGHNUT,
Messages.LabelStatementOfAssetsHoldings);
IdNodeDataModel data = "">
// root node must inherit background color (dark mode)
data.getRootNode().setColor(chart.getBackground());
snapshot.getAssetPositions() //
.forEach(p -> {
Slice slice = new Slice(p.getDescription(),
p.getValuation().getAmount() / Values.Amount.divider(), data.getRootNode());
slice.setColor(colorWheel.next());
slice.setData(p);
});
data.update();
Couple questions:
The datamodel#update method resets the colors, but if I do not call model#update, no data is shown
I did extend the "Node" class now to add a "data" object. It allows me to attach the actual object. Is this a meaningful extension to the API?
About labels: is the drawing of labels next to (or inside) the pie slices supported? I tried the following code but to no avail.
circularSeries.getLabel().setVisible(true);
Thanks!
Andreas.