0

does not execute event onPlotShow and onPlotHide in charts type pie

asked 2019-05-31 00:01:35 +0800

mfinis gravatar image mfinis
3

updated 2019-06-12 11:10:00 +0800

cor3000 gravatar image cor3000
6280 2 7

Help! I am trying to implement the events that show and hide series in pie chart but do not recognize or execute those events.

This is my implementation:

chart.addEventListener (ChartsEvents.ON_PLOT_HIDE, new EventListener <Event> () { 
    public void onEvent (Event event) throws Exception { // ... }
});

Please someone who can guide me ?. The version of zk I use is ZK 8.5.1.2 EE

delete flag offensive retag edit

5 Answers

Sort by ยป oldest newest most voted
0

answered 2019-05-31 11:21:21 +0800

hawk gravatar image hawk
3250 1 5
http://hawkphoenix.blogsp... ZK Team

ON_PLOT_HIDE is fired when you click a legend to hide a series.

I don't understand the problem you encounter. Doesn't the event ON_PLOT_HIDE fire in your environment? or do you need to hide a series?

please read the related example https://github.com/zkoss/zkchartsessentials/blob/master/src/main/webapp/event/events.zul

Maybe it can help you.

link publish delete flag offensive edit
0

answered 2019-06-08 08:53:24 +0800

mfinis gravatar image mfinis
3

Look, my problem is that the ONPLOTHIDE event is not activated for the type of PIE chart, I have another implementation with a BAR type chart and there if the event works correctly.

link publish delete flag offensive edit
0

answered 2019-06-10 15:43:56 +0800

hawk gravatar image hawk
3250 1 5
http://hawkphoenix.blogsp... ZK Team

ON_PLOT_HIDE / ON_PLOT_SHOW are not applicable for a pie chart. Because when you click a legend of a pie chart, it hides a point instead of a series. Those 2 events are fired when you hide a series.

ON_PLOT_LEGEND_ITEM_CLICK could be an alternative, but it's also not applicable on a pie chart.

Another option is to listen to ON_PLOT_SELECT, let a user clicks a division of a pie chart.

link publish delete flag offensive edit
0

answered 2019-06-12 00:48:24 +0800

mfinis gravatar image mfinis
3

Thank you very much for your contribution, in fact I already probe the events that you comment but here the question is that additionally I need that the points of the pie chart are not hidden, I need to remove that effect that they are not hidden from the click.

link publish delete flag offensive edit
0

answered 2019-06-12 11:05:48 +0800

cor3000 gravatar image cor3000
6280 2 7

updated 2019-06-12 11:07:31 +0800

As mentioned by Hawk the Pie chart legend hides points instead of series. This is reflected in the Highcharts JS API on plotOptions.pie.point.events -> leading to the official example.

Since the ZK Charts API doesn't duplicate the full set of properties it was designed for extensibility.

So in order to define a client side event listener you can use the API method addExtraAttr which allows JSON or JavaScript values containing functions.

chart.getPlotOptions().getPie().addExtraAttr("point",
         new JavaScriptValue("{ events: { legendItemClick: e => false } }"));

The above will add an event listener for legendItemClick returning false ... ignoring the event, and keeping the chart slice visible.

(For older browsers you can replace e => false with function(event) {return false;})

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2019-05-31 00:01:35 +0800

Seen: 19 times

Last updated: Jun 12 '19

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More