XChart icon indicating copy to clipboard operation
XChart copied to clipboard

Give the possibility to supply a custom label generator for pie charts

Open ggiambo opened this issue 10 months ago • 2 comments

See #698.

Demo of PieChart02 with labels showing percentage:

Before immagine

After immagine

ggiambo avatar Apr 26 '24 18:04 ggiambo

Thanks for putting in the effort to change the implementation from your previous PR. Can you change the demo to be in the same format at in https://github.com/knowm/XChart/blob/a9f75d4178d52dbd3688e06072e6dde701026532/xchart-demo/src/main/java/org/knowm/xchart/demo/charts/date/DateChart09.java#L67, i.e.



            x -> startTime.plusDays(x.longValue()).format(cursorXFormatter)

, without needing to define chart.getSeriesMap().values()?

timmolter avatar Jun 06 '24 08:06 timmolter

Hi @timmolter I'm not sure I full understand your request. I guess you want to avoid the call to Chart#getSeriesMap, that is marked for removal, am I right? In commit 44f6a189d4e5f22beb4d5a4598203e703038eb29 I tried to gather the total without accessing to the whole series map.

ggiambo avatar Jun 07 '24 09:06 ggiambo