1234 --> 1.234

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
torsten

1234 --> 1.234

Post by torsten » Wed Jan 29, 2003 10:35 am

Hi all,
in a bar chart I want to show the y-axis with "thousend-separator", like 1.234.
I use the VerticalCategoryPlot.setLabelFormatString("#,###").
It works fine with the y-axis like:
0 - 1.000 - 2.000 - 3.000 - 4.000...
but it doesnt work vor values with y-axis like:
0 - 500 -1000 - 1500 - 2000 - 2500...

Is this a bug or am I a too stupid? ;))

Thanks a lot.
torsten.

David Gilbert

Re: 1234 --> 1.234

Post by David Gilbert » Thu Jan 30, 2003 12:44 am

The x-axis in a bar chart displays categories, not values. JFreeChart thinks of all categories as Objects, and gets the label from the toString() method. There is no formatting...

Regards,

Dave Gilbert

torsten

Re: 1234 --> 1.234

Post by torsten » Thu Jan 30, 2003 8:49 am

Hello Dave,
thanks for your response.
I want to display this formatting on the y-axis. I think I wrote this.
I already use VerticalCategoryPlot.setLabelFormatString("#,###") in this and it works, except for value series like 0 - 250 - 500 - 750 - 1000 - 1250 - 1500 - .....

Hope you have a little time agian,
thanks a lot,
torsten.

Paolo

Re: 1234 --> 1.234

Post by Paolo » Thu Jan 30, 2003 7:19 pm

I think the method you are using, setLabelFormatString, will affect the formatting of value labels for the individual bars. In any case, what you want is to change the format used for the vertical axis tick labels. Check setTickUnit(NumberTickUnit unit) in NumberAxis.

torsten

Re: 1234 --> 1.234

Post by torsten » Fri Jan 31, 2003 3:51 pm

Hi again,
this is not exactly waht I searched for but I think this should work for me!

Thanks a lot and have a nice weekend,
torsten.

Locked