use of org.jfree.chart.axis.NumberAxis in project processdash by dtuma.
the class AreaChart method createChart.
/** Create a line chart. */
public JFreeChart createChart() {
JFreeChart chart;
CategoryDataset catData = data.catDataSource();
Object stacked = parameters.get("stacked");
if (stacked != null) {
chart = ChartFactory.createStackedAreaChart(null, null, null, catData, PlotOrientation.VERTICAL, true, true, false);
if ("pct".equals(stacked)) {
((StackedAreaRenderer) chart.getCategoryPlot().getRenderer()).setRenderAsPercentages(true);
DecimalFormat fmt = new DecimalFormat();
fmt.setMultiplier(100);
((NumberAxis) chart.getCategoryPlot().getRangeAxis()).setNumberFormatOverride(fmt);
if (parameters.get("units") == null)
parameters.put("units", "%");
}
} else {
chart = ChartFactory.createAreaChart(null, null, null, catData, PlotOrientation.VERTICAL, true, true, false);
}
setupCategoryChart(chart);
Object colorScheme = parameters.get("colorScheme");
if ("consistent".equals(colorScheme))
configureConsistentColors(chart.getCategoryPlot(), catData);
else if (parameters.containsKey("c1"))
configureIndividualColors(chart.getCategoryPlot(), catData);
return chart;
}
Aggregations