0
votes

I have implemented a wicked-chart which shows 4 series in the legend. Now I want to handle the series click event in legend and update some values outside the wicked highchart. To be specific, I want to implement exactly like this jsfiddle but in java wicked-chart.

plotOptions: 
     {    
        series: {    
            events: {    
               legendItemClick: function(event) {    
                   //Do something here    
                   return false;    
                    }    
                }

I did search all the methods of PlotOptions class but could get something similar to highcharts legendItemClick event.

1
always is an option use the the jQuery plugin directlyosdamv
Have you tried to use java wrappers? highcharts.com/downloadSebastian Bochan

1 Answers

0
votes

My solution was not to find alternative for legendItemClick in wicket-charts as they do not have one. Instead I did this:

In your page html, give id="chart". Doing this highcharts shall fix your id to "chartVar" instead of changing it at each run.

 <div wicket:id="chart" id="chart"></div>

In your javascript, define your series click using .highcharts-legend-item as below.

 var onSeriesClick = function() {
    var that = this;
    for (var i=0;i<chartVar.series.length;i++)
    {
        $(".highcharts-legend-item:contains(" + chartVar.series[i].name + ")").click(function(){
            // your legend click logic goes here                    
        });
    }
}