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