{
categoryAxis.setCategoryMargin(categoryMargin.doubleValue());
}
final ValueAxis rangeAxis = cpl.getRangeAxis();
if (rangeAxis instanceof NumberAxis)
{
final NumberAxis numberAxis = (NumberAxis) rangeAxis;
if (getRangePeriodCount() > 0)
{
if (getRangeTickFormat() != null)
{
numberAxis.setTickUnit(new NumberTickUnit(getRangePeriodCount(), getRangeTickFormat()));
}
else if (getRangeTickFormatString() != null)
{
final FastDecimalFormat formatter = new FastDecimalFormat
(getRangeTickFormatString(), getResourceBundleFactory().getLocale());
numberAxis.setTickUnit(new FastNumberTickUnit(getRangePeriodCount(), formatter));
}
else
{
numberAxis.setTickUnit(new FastNumberTickUnit(getRangePeriodCount()));
}
}
else
{
if (getRangeTickFormat() != null)
{
numberAxis.setNumberFormatOverride(getRangeTickFormat());
}
else if (getRangeTickFormatString() != null)
{
final DecimalFormat formatter = new DecimalFormat
(getRangeTickFormatString(), new DecimalFormatSymbols(getResourceBundleFactory().getLocale()));
numberAxis.setNumberFormatOverride(formatter);
}
}
}
else if (rangeAxis instanceof DateAxis)
{
final DateAxis numberAxis = (DateAxis) rangeAxis;
if (getRangePeriodCount() > 0 && getRangeTimePeriod() != null)
{
if (getRangeTickFormatString() != null)
{
final SimpleDateFormat formatter = new SimpleDateFormat
(getRangeTickFormatString(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
numberAxis.setTickUnit
(new DateTickUnit(getDateUnitAsInt(getRangeTimePeriod()), (int) getRangePeriodCount(), formatter));
}
else
{
numberAxis.setTickUnit
(new DateTickUnit(getDateUnitAsInt(getRangeTimePeriod()), (int) getRangePeriodCount()));
}
}
else if (getRangeTickFormatString() != null)
{
final SimpleDateFormat formatter = new SimpleDateFormat
(getRangeTickFormatString(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
numberAxis.setDateFormatOverride(formatter);
}
}
if (rangeAxis != null)
{
rangeAxis.setLabelFont(labelFont);
rangeAxis.setTickLabelFont(labelFont);
if (getRangeTitleFont() != null)
{
rangeAxis.setLabelFont(getRangeTitleFont());
}
if (getRangeTickFont() != null)
{
rangeAxis.setTickLabelFont(getRangeTickFont());
}
if (getRangeMinimum() != ValueAxis.DEFAULT_LOWER_BOUND)
{
rangeAxis.setLowerBound(getRangeMinimum());
}
if (getRangeMaximum() != ValueAxis.DEFAULT_UPPER_BOUND)
{
rangeAxis.setUpperBound(getRangeMaximum());
}
}
}