protected void _outputJSChartModel(
StringWriter sw,
UIComponent component) throws IOException
{
CoreChart chart = (CoreChart)component;
ChartModel model = (ChartModel)chart.getValue();
if(model==null)
{
_LOG.severe("Model not specified for the chart component.");
return;
}
sw.append("var seriesLabels = ");
_writeJSObject(sw, model.getSeriesLabels());
sw.append(";\n");
sw.append("var groupLabels = ");
_writeJSObject(sw, model.getGroupLabels());
sw.append(";\n");
sw.append("var seriesColors = ");
_writeJSObject(sw, model.getSeriesColors());
sw.append(";\n");
sw.append("var xValues = ");
_writeJSObject(sw, model.getXValues());
sw.append(";\n");
sw.append("var yValues = ");
_writeJSObject(sw, model.getYValues());
sw.append(";\n");
sw.append("var model = new ApacheChartModel(seriesLabels, groupLabels, yValues, xValues, seriesColors);\n");
sw.append("model.setMinYValue(");
_writeJSObject(sw, model.getMinYValue());
sw.append(");\n");
sw.append("model.setMaxYValue(");
_writeJSObject(sw, model.getMaxYValue());
sw.append(");\n");
sw.append("model.setMinXValue(");
_writeJSObject(sw, model.getMinXValue());
sw.append(");\n");
sw.append("model.setMaxXValue(");
_writeJSObject(sw, model.getMaxXValue());
sw.append(");\n");
sw.append("model.setTitle(");
_writeJSObject(sw, model.getTitle());
sw.append(");\n");
sw.append("model.setSubTitle(");
_writeJSObject(sw, model.getSubTitle());
sw.append(");\n");
sw.append("model.setFootNote(");
_writeJSObject(sw, model.getFootNote());
sw.append(");\n");
}