Frage

enter image description here

I have a stacked bar chart like in the image above. What i need is to show both series names and values on each bar. How can i do that?

I can show series with this code:

renderer.setBaseItemLabelGenerator(
            new StandardCategoryItemLabelGenerator("{0}", NumberFormat.getInstance()));
War es hilfreich?

Lösung

I found the way to show both of them. The trick is to define each parameters format sequentially. Here is the code:

       renderer.setBaseItemLabelGenerator(
new StandardCategoryItemLabelGenerator("{0} {2}", NumberFormat.getInstance(),NumberFormat.getNumberInstance()));
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top