@Override
protected void encodeOptions(FacesContext context, Chart chart) throws IOException {
super.encodeOptions(context, chart);
ResponseWriter writer = context.getResponseWriter();
OhlcChartModel model = (OhlcChartModel) chart.getModel();
if(model.isCandleStick())
writer.write(",candleStick:true");
if(model.isZoom())
writer.write(",zoom:true");
if(model.isAnimate())
writer.write(",animate:true");
if(model.isShowDatatip()) {
writer.write(",datatip:true");
if(model.getDatatipFormat() != null)
writer.write(",datatipFormat:\"" + model.getDatatipFormat() + "\"");
}
}