Hi,
i need a bar chart with different colored bars and a title next to each bar, something like this:
title1 [bar1--color1------]
title2 [bar2--color2--------]
title3 [bar3--color3----------]
title4 [bar4--color4-----]
title5 [bar5--color5-------------]
title6 [bar5--color6--------]
with one category and many series I get the colors but only one category title. With many categories and one series I get the titles but just one color.
Is it possible ?
Thanks,
Eddy
bars with title and colors?
Re: bars with title and colors?
There's only one color per series...changing that would mess up the legend. However, if you really want to do it then you should make your own renderer...subclass HorizontalBarRenderer and override the draw method (that's where the series color is set).
Regards,
DG.
Regards,
DG.
Re: bars with title and colors?
Hi:
Several people have requested this, and I need it too. I have discovered a way that doesn't require any special coding at all. The key is to use stacked bar charts.
Think of chart data as a matrix where the rows are series and columns are categories. Build an nxn matrix of zeros, put your single series of data down the diagonal, and give this to a stacked vertical bar chart. The chart thinks you have n series each of which has nonzero data in a unique category and zeros elsewhere. Each category will have a different color (up to nine or whatever). The legend even works, although I usually turn it off.
I didn't think of this. My wife did. All credit to her.
Nish
Several people have requested this, and I need it too. I have discovered a way that doesn't require any special coding at all. The key is to use stacked bar charts.
Think of chart data as a matrix where the rows are series and columns are categories. Build an nxn matrix of zeros, put your single series of data down the diagonal, and give this to a stacked vertical bar chart. The chart thinks you have n series each of which has nonzero data in a unique category and zeros elsewhere. Each category will have a different color (up to nine or whatever). The legend even works, although I usually turn it off.
I didn't think of this. My wife did. All credit to her.
Nish