run the attached example (chart-change-type.zul) and toggle the chart type:
with every update the chart data is appended again (below extracts from the AJAX responses from the server to the browser)
initial rendering:
plotData:{"chart":{},"series":[{"data":[4,7],"name":"Claim"}]
after changing type to "bar":
plotData:{"chart":{"type":"bar"},"series":[{"data":[4,7,4,7],"name":"Claim"}]
after changing type back to "line":
plotData:{"chart":{"type":"line"},"series":[{"data":[4,7,4,7,4,7],"name":"Claim"}]
WORKAROUND:
// WORKAROUND 1 - reset the same model ChartsModel oldModel = mychart.getModel(); mychart.setModel(new DefaultCategoryModel()); mychart.setModel(oldModel);
// WORKAROUND 2 - replace with a new model
mychart.setModel(createModel());