Hi,
I need your help... I have a code that generate a Bar Chart (simple code), this is:
.
.
.
JFreeChart jfcChart;
Double[][] data = (Double[][])arlData.get(0);
String[] serie = (String[])arlData.get(1);
String[] labels = (String[])arlData.get(2);
Object[] category = labels;
DefaultCategoryDataset dcdDataset = new DefaultCategoryDataset(data);
dcdDataset.setSeriesNames(serie);
dcdDataset.setCategories(category);
CategoryDataset cdData = dcdDataset;
jfcChart = ChartFactory.createStackedVerticalBarChart ((String)arlData.get(3), (String)arlData.get(4), (String)arlData.get(5), cdData, true);
jfcChart.setBackgroundPaint(new GradientPaint(0, 0, Color.white, 1000, 0, Color.white));
.
.
.
how I can put labels on each Bar?
thanks...
Regards.
Legends in Bar chart
Re: Legends in Bar chart
I'm pretty sure that you can't display labels for each bar in a stacked bar chart. If you want to modify the code, the place to draw the labels would be in the drawCategoryItem(...) method in the StackedVerticalBarRenderer or the StackedHorizontalBarRenderer class (depending on the orientation of the chart you are using).
Regards,
DG.
Regards,
DG.
Re: Legends in Bar chart
Thanks David,
but I don't understand very well... look:
| 5
| * 4
| * 3 *
| * * *
| * * * 1
| * * * *
-------------------------------------------
I need puy values on the top foe each bar, is it possible with my code or I need use other class?...
where I find documentation for JfreeChart?...
thanks, again...
Regards
Hgeeks
but I don't understand very well... look:
| 5
| * 4
| * 3 *
| * * *
| * * * 1
| * * * *
-------------------------------------------
I need puy values on the top foe each bar, is it possible with my code or I need use other class?...
where I find documentation for JfreeChart?...
thanks, again...
Regards
Hgeeks