Hi,
I would like to display the value of the bars on the domain-axis
instead of category names. I use the DefaultCategorySet, which
I add values to like this:
dataset.addValue(2.5, null, "Cat 1");
dataset.addValue(2.7, null, "Cat 2");
This displays "Cat 1" and "Cat 2" on the domain axis,
but I would like to show the values "2.5" and "2.6".
It works fine as long as the values differs, but when
the values are the same, the bars are merged into one.
Is it possible to display categories that are not unique
on the domain axis?
This may seem strange, but the categories will be shown as icons
above the chart.
Regards,
Joel
Display non-unique categories in bar chart?
Re: Display non-unique categories in bar chart?
Hi Joel,
The categories must be unique, since they are used as a key for accessing the data. The approach I would use to display values along the category axis is to subclass the HorizontalCategoryAxis class and override the refreshTicks(...) method. There is a line:
String label = category.toString();
You could change that to the value for the category.
Regards,
Dave Gilbert
The categories must be unique, since they are used as a key for accessing the data. The approach I would use to display values along the category axis is to subclass the HorizontalCategoryAxis class and override the refreshTicks(...) method. There is a line:
String label = category.toString();
You could change that to the value for the category.
Regards,
Dave Gilbert