Hi,
I have the following problem. My charts display onfo with very high Y coordinates. Let's say the Y range falls between $100,000,000 and $600,000,000. As a result there is a lot of space wasted on the tick labels since JFreeChart generates $100,000,000.00. Is it possible to configure the chart to generate numbers in millions of dollars, which would get translated into much more compact labels between 100 and 600?
Thanks.
Scaling Y axis.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
The best approach would be to write your own subclass of NumberFormat to handle this. I'll put it on my to-do list, because it would be nice to have this feature generally available.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Thanks for the prompt reply, David.
Unfortunately, writing a custom formatter is not a viable option for me because the requirement is - based on the dataset, being able to scale either by deviding by 1000, or by 1000000 or 1000000000. For example, if maximum value in the dataset is greater than 1000000 but less than 1000000000, we would like to devide eahc value by 1000000 and present all tick labels in millions. So this requires analyzing the whole dataset before making a decision how to scale.
Unfortunately, writing a custom formatter is not a viable option for me because the requirement is - based on the dataset, being able to scale either by deviding by 1000, or by 1000000 or 1000000000. For example, if maximum value in the dataset is greater than 1000000 but less than 1000000000, we would like to devide eahc value by 1000000 and present all tick labels in millions. So this requires analyzing the whole dataset before making a decision how to scale.
-
- Posts: 1
- Joined: Thu Oct 06, 2005 2:27 am
David (or anyone else) made this addition to the codebase yet?
I have a very similar need - data might be in the 0, kilo or mega range, and I want the axis to note the top end of the scale and suffix the axis appropriately ie 10k instead of 10,000.
I will go and implement myself if not already done...
I have a very similar need - data might be in the 0, kilo or mega range, and I want the axis to note the top end of the scale and suffix the axis appropriately ie 10k instead of 10,000.
I will go and implement myself if not already done...
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
It hasn't been done...if you can contribute something, that would be awesome!
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

