-
Bug
-
Resolution: Invalid
-
Major
-
3.0.3
-
Security Level: Jimmy
-
None
Steps to Reproduce
1. run the code
<div apply="org.zkoss.zkcharts.essentials.exporting.ExportComposer"> <charts id="mychart" type="pie"/> </div>
public class ExportComposer extends SelectorComposer<Component> { @Wire private Charts mychart; private static final String ON_MY_CUSTOM_ITEM = "onMyCustomItem"; private SingleValueCategoryModel model = new DefaultSingleValueCategoryModel(); @Override public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); model.setValue("Mine",32); model.setValue("Yours",12); model.setValue("His",20); model.setValue("Ours",14); model.setValue("Theirs",55); mychart.setModel(model); mychart.getPlotOptions().getPie().setShowInLegend(true); mychart.addEventListener(ChartsEvents.ON_PLOT_LEGEND_ITEM_CLICK, new EventListener<Event>() { @Override public void onEvent(Event event) throws Exception { System.out.println(event); } }); } };
2. click a legend to hide a division of a pie
Current Result
- nothing printed at the server-side
- ZKCharts doesn't send any AU request
Expected Result
ZKCharts sends an AU request
Debug Information
- https://api.highcharts.com/highcharts/plotOptions.pie.point.events.legendItemClick
- zkcharts essential said this event doesn't apply on pie chart. If it's limited by the specification, please put the link.
Workaround
handle it at client-side
chart.getPlotOptions().getPie().addExtraAttr("point", new JavaScriptValue("{ events: { legendItemClick: e => false } }"));