protected void configureChart(final JFreeChart chart)
{
super.configureChart(chart);
final CategoryPlot plot = chart.getCategoryPlot();
if (isSharedRangeAxis() == false)
{
final ValueAxis linesAxis = plot.getRangeAxis(1);
if (linesAxis instanceof NumberAxis)
{
final NumberAxis numberAxis = (NumberAxis) linesAxis;
numberAxis.setAutoRangeIncludesZero(isLineAxisIncludesZero());
numberAxis.setAutoRangeStickyZero(isLineAxisStickyZero());
if (getLinePeriodCount() > 0)
{
if (getLineTicksLabelFormat() != null)
{
final FastDecimalFormat formatter = new FastDecimalFormat
(getLineTicksLabelFormat(), getResourceBundleFactory().getLocale());
numberAxis.setTickUnit(new FastNumberTickUnit(getLinePeriodCount(), formatter));
}
else
{
numberAxis.setTickUnit(new FastNumberTickUnit(getLinePeriodCount()));
}
}
else
{
if (getLineTicksLabelFormat() != null)
{
final DecimalFormat formatter = new DecimalFormat
(getLineTicksLabelFormat(), new DecimalFormatSymbols(getResourceBundleFactory().getLocale()));
numberAxis.setNumberFormatOverride(formatter);
}
}
}
else if (linesAxis instanceof DateAxis)
{
final DateAxis numberAxis = (DateAxis) linesAxis;
if (getLinePeriodCount() > 0 && getLineTimePeriod() != null)
{
if (getLineTicksLabelFormat() != null)
{
final SimpleDateFormat formatter = new SimpleDateFormat
(getLineTicksLabelFormat(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
numberAxis.setTickUnit
(new DateTickUnit(getDateUnitAsInt(getLineTimePeriod()), (int) getLinePeriodCount(), formatter));
}
else
{
numberAxis.setTickUnit
(new DateTickUnit(getDateUnitAsInt(getLineTimePeriod()), (int) getLinePeriodCount()));
}
}
else if (getRangeTickFormatString() != null)
{
final SimpleDateFormat formatter = new SimpleDateFormat
(getRangeTickFormatString(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
numberAxis.setDateFormatOverride(formatter);
}
}
if (linesAxis != null)
{
final Font labelFont = Font.decode(getLabelFont());
linesAxis.setLabelFont(labelFont);
linesAxis.setTickLabelFont(labelFont);
if (getLineTitleFont() != null)
{
linesAxis.setLabelFont(getLineTitleFont());
}
if (getLineTickFont() != null)
{
linesAxis.setTickLabelFont(getLineTickFont());
}
final int level = getRuntime().getProcessingContext().getCompatibilityLevel();
if (ClassicEngineBoot.isEnforceCompatibilityFor(level, 3, 8))
{
if (getRangeMinimum() != 0)
{
linesAxis.setLowerBound(getLineRangeMinimum());
}
if (getRangeMaximum() != 1)
{
linesAxis.setUpperBound(getLineRangeMaximum());
}
if (getLineRangeMinimum() == 0 && getLineRangeMaximum() == 1)
{
linesAxis.setLowerBound(0);
linesAxis.setUpperBound(1);
linesAxis.setAutoRange(true);
}
}
else
{
linesAxis.setLowerBound(getLineRangeMinimum());
linesAxis.setUpperBound(getLineRangeMaximum());
linesAxis.setAutoRange(isLineAxisAutoRange());
}
}
}
final LineAndShapeRenderer linesRenderer = (LineAndShapeRenderer) plot.getRenderer(1);
if (linesRenderer != null)
{
//set stroke with line width
linesRenderer.setStroke(translateLineStyle(lineWidth, lineStyle));
//hide shapes on line