How to hide a piece of high-definition cake programmatically

I have a pie chart diagram that allows me to remove fragments by clicking on a legend.

http://jsfiddle.net/f3Lx6cxk/

I want to programmatically hide fragments after rendering a chart. In my jsfiddle, the button calls

chart.series[0].data[i].select(); 

leading to shear shear. I need a similar call to remove the slice as a whole, but leave it gray in the legend (so point.remove is not good). The effect should be the same as clicking on the legend item.

+5
source share
1 answer

You can use the setVisible function:

  $('#button').click(function () { if(sliced) chart.series[0].data[0].setVisible(true); else chart.series[0].data[0].setVisible(false); sliced=!sliced; }); 

http://jsfiddle.net/f3Lx6cxk/1/

+4
source

Source: https://habr.com/ru/post/1209339/


All Articles