Auto Tick With Formatting

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

Auto Tick With Formatting

Post by Joe Sousa » Thu Dec 05, 2002 12:28 am

Is it possible to set the tick format, say to $##,###,##0, and yet maintain the auto-tick-unit selection so that the axis is automatically scaled? We are generating charts on the fly for costs of a service that the user selects and maximum cost varies considerably between services. Thanks for any help. JS

David Gilbert

Re: Auto Tick With Formatting

Post by David Gilbert » Mon Dec 09, 2002 11:43 pm

Hi Joe,

Sorry for the delayed response. In the next release of JFreeChart, there will be a method you can use to specify an "override" format that will be applied to whichever tick unit is selected for the axis.

Until then, the best workaround is to create your own TickUnits collection and register it with the setStandardTickUnits(...) method in the ValueAxis class. You can add any number of TickUnit objects to the TickUnits collection (see the createStandardTickUnits() method in the NumberAxis class for one example).

Regards,

DG

Locked