Hi,
I noticed in 0.9.2 there is a method on the CategoryPlot class called setLabelsVisible()...
This does make labels visible at the top of Vertical Bar Charts...
Exist the same functionality for StackedVerticalBarChart?...
Thanks.
Hgeeks
Labels in StackedVerticalBarChart
Re: Labels in StackedVerticalBarChart
There isn't any code to display labels in the stacked bar charts (yet).
Regards,
DG.
Regards,
DG.
Re: Labels in StackedVerticalBarChart
I implemented a solution in the drawCategory Method. SImple but proved to be effective - and follows the initial implmenetation for normal bar charts
if (plot.getLabelsVisible()) {
Font labelFont = plot.getLabelFont();
g2.setFont(labelFont);
Paint paint = plot.getLabelPaint();
g2.setPaint(paint);
String dvalue = String.valueOf(value);
g2.drawString(dvalue, (float)(rectX + (rectWidth/3)), (float)(bar.getCenterY() + 3));
}
if (plot.getLabelsVisible()) {
Font labelFont = plot.getLabelFont();
g2.setFont(labelFont);
Paint paint = plot.getLabelPaint();
g2.setPaint(paint);
String dvalue = String.valueOf(value);
g2.drawString(dvalue, (float)(rectX + (rectWidth/3)), (float)(bar.getCenterY() + 3));
}