I need help figuring out how to do a custom itemLabelGenerator. I would like the label to include the numerical value and the percentage of some other value. E.g a bar chart with
Item A XXXXXXXXXXXXXX 1000 (100%)
Item B XXXXXXXXXXX 777 (77.7%)
Item C XXXXX 333 (33.3%)
Thanks.
custom itemLabelGenerator
-
- Posts: 22
- Joined: Thu Jan 29, 2004 8:28 pm
custom itemLabelGenerator
If you were describing category labels (domain axis) in your example, one way I think possible is to use the DefaultCategoryDataset. For each value of the x-axis, ie 1000, 777, 333, you derive a associated category string, ie "1000 (100%)", "777 (77.7%)", and "333 (33.3%)", respectively.
Then invoking
DefaultCategoryDataset.addValue(aRangeValue, "SeriesString", theAboveAssociatedCategoryLabel);
I believe that should do it.
Use LineChart, or BarChart
Hope it works!
Then invoking
DefaultCategoryDataset.addValue(aRangeValue, "SeriesString", theAboveAssociatedCategoryLabel);
I believe that should do it.
Use LineChart, or BarChart
Hope it works!