private SimpleXYChartSupport createChart(DataTypeEnum dataType,
ChartTypeEnum chartType, String name, String[] lineItems,
String xDesc, String yDesc, String[] dataItemKeys) {
SimpleXYChartDescriptor description;
if (dataType == DataTypeEnum.DECIMAL) {
description = SimpleXYChartDescriptor.decimal(0, true, 1000);
} else {
description = SimpleXYChartDescriptor.bytes(0, true, 1000);
}
description.setChartTitle(name);
if (chartType == ChartTypeEnum.LINE) {
description.addLineItems(lineItems);
} else {
description.addFillItems(lineItems);
}
description.setXAxisDescription(xDesc);
description.setYAxisDescription(yDesc);
final SimpleXYChartSupport chart = ChartFactory.createSimpleXYChart(description);
charts.put(chart, dataItemKeys);
return chart;
}