@Override
protected void encodeOptions(FacesContext context, Chart chart) throws IOException {
super.encodeOptions(context, chart);
ResponseWriter writer = context.getResponseWriter();
DonutChartModel model = (DonutChartModel) chart.getModel();
int sliceMargin = model.getSliceMargin();
boolean fill = model.isFill();
boolean showDataLabels = model.isShowDataLabels();
String dataFormat = model.getDataFormat();
if(sliceMargin != 0) writer.write(",sliceMargin:" + sliceMargin);
if(!fill) writer.write(",fill:false");
if(showDataLabels) writer.write(",showDataLabels:true");
if(dataFormat != null) writer.write(",dataFormat:\"" + dataFormat + "\"");