protected void encodeOptions(FacesContext context, BarChart chart) throws IOException {
super.encodeOptions(context, chart);
ResponseWriter writer = context.getResponseWriter();
CartesianChartModel model = (CartesianChartModel) chart.getValue();
//axes
writer.write(",axes:{");
encodeAxis(context, "xaxis", chart.getXaxisLabel(), chart.getXaxisAngle(), Double.MIN_VALUE, Double.MAX_VALUE);
encodeAxis(context, ",yaxis", chart.getYaxisLabel(), chart.getYaxisAngle(), Double.MIN_VALUE, Double.MAX_VALUE);
writer.write("}");
//series
writer.write(",series:[");
for(Iterator<ChartSeries> it = model.getSeries().iterator(); it.hasNext();) {
ChartSeries series = (ChartSeries) it.next();
String seriesRenderer = series.getRenderer();
boolean fill = series.isFill();
writer.write("{");