*/
@Override
public void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component)
throws IOException {
AbstractChart chart = (AbstractChart) component;
VisitChart visitCallback = new VisitChart(chart);
// copy attributes to parent tag and process data
chart.visitTree(VisitContext.createVisitContext(FacesContext
.getCurrentInstance()), visitCallback);
// store data to parent tag
component.getAttributes().put("chartData", visitCallback.getData());
if (!visitCallback.isDataEmpty()) {
component.getAttributes().put("charttype",
visitCallback.getChartType());
component.getAttributes().put("xtype",
axisDataTypeToString(visitCallback.getKeyType()));
component.getAttributes().put("ytype",
axisDataTypeToString(visitCallback.getValType()));
}
//set flag whether request to server should be sent
boolean anyServerSideListener = chart.getPlotClickListener()!=null?true:false;
if(!anyServerSideListener){
//check if there is particular series listener
List<MethodExpression> listeners = visitCallback.getParticularSeriesListeners();
for (MethodExpression methodExpression : listeners) {
if(methodExpression!=null){