1

I have the following implementation.

http://jsfiddle.net/ao617j2j/

I would like to know when a user clicks on the categoryAxis label, it should hide/unhide corresponding bar stack.

categoryAxis: {
  categories: ["First Stock", "Second Stock", "Third Stock", "Fourth Stock", "Fifth Stock"],
},
casillas
  • 16,351
  • 19
  • 115
  • 215

1 Answers1

2

You can add axisLabelClick event in this case, and get series data with relevant index and set the value to 0 and redraw it. I create a snippet code to hide the bar, to show the bar again I think you already got the idea. Good Luck! :D

axisLabelClick: function(e) {
    var series = e.sender.options.series;

    $.each(series, function(i, item){
      item.data[e.index] = 0;
    });
    e.sender.redraw();
}
Dion Dirza
  • 2,575
  • 2
  • 17
  • 21
  • 1
    setting the value to null instead of zero will make the chart leave a gap: http://jsfiddle.net/ao617j2j/3/ – ezanker May 21 '15 at 12:33
  • Thanks a lot Dion and Ezanker. – casillas May 21 '15 at 14:09
  • I have started learning kendo recently. I have been looking questions on SOF. I would like to know the following question if you have any idea. Thanks alot in advance. http://stackoverflow.com/questions/30377141/changing-the-start-point-in-stack-bar-chart – casillas May 21 '15 at 14:47