Hi,
I found a little bug in JFreeChart.
I had a problem with formatting a VertivalNumberAxis. I defined a DecimalFormatSymbols for a new pattern :
VerticalNumberAxis myVerticalAxis = (VerticalNumberAxis) myPlot.getAxis(Plot.VERTICAL_AXIS);
java.text.DecimalFormatSymbols dfs = new java.text.DecimalFormatSymbols();
dfs.setGroupingSeparator('.');
dfs.setDecimalSeparator(',');
myVerticalAxis.getTickLabelFormatter().setDecimalFormatSymbols(dfs);
But when I resize the graph, the format symbols change to the defaults.
In the refreshTicks of the VerticalNumberAxis, I have change the following line to keep the format symbols :
DecimalFormatSymbols decimalFormatSymbols = tickLabelFormatter.getDecimalFormatSymbols();
tickLabelFormatter = new DecimalFormat(tickLabelFormatter.toPattern());
tickLabelFormatter.setDecimalFormatSymbols(decimalFormatSymbols);
And it works.
Regards,
Fabien
Format a VerticalNumberAxis
RE: Format a VerticalNumberAxis
Hi Fabien,
Thanks for your post. The work-around you suggest looks good. Actually it's a workaround on top of a workaround - take a look at these early postings in the JFreeChart discussion forum:
<a href="http://jrefinery.com/forums/read.phtml? ... 6&t=116</a>
Regards,
DG.
Thanks for your post. The work-around you suggest looks good. Actually it's a workaround on top of a workaround - take a look at these early postings in the JFreeChart discussion forum:
<a href="http://jrefinery.com/forums/read.phtml? ... 6&t=116</a>
Regards,
DG.