

This example illustrates how to control the axis tick density in auto-scaling.
In auto-scaling, ChartDirector will automatically choose an appropriate tick spacing for the axis.
In some special cases, you may want to use a different tick spacing. The Axis.setTickDensity method can be used to specify the desired distance between two ticks.
Note that the actual tick spacing chosen by ChartDirector may not be equal to the given desired tick density. It is because ChartDirector may have other constraints when choosing the ticks. For example, the axis may need to contain an integral number of ticks (depends on Axis.setRounding set up), the ticks and axis range should be neat numbers, etc. ChartDirector may use a tick spacing that is larger than suggested, but never smaller.
In this example, one of the charts is drawn using the default tick spacing. The other chart is drawn using a desired tick spacing of 10 pixels. Note that the actual tick spacing is slightly larger than 10 pixels.