Getting selectedIndex of pie chart

Posted by: ed on 25 March 2019, 8:09 pm EST

    • Post Options:
    • Link

    Posted 25 March 2019, 8:09 pm EST

    I am trying to get the index of selected pie segment when the user clicks on the pie chart. I added the following to the on load function but the event isn’t firing when I click on the chart.

    var agingChart = new wijmo.chart.FlexPie(‘#agingChart’, {});

    agingChart.selectionChanged.addHandler(function(e)

    {

    alert(e.selectedIndex);

    });

    Thanks, Ed

  • Posted 26 March 2019, 2:10 am EST

    Hi,

    For selecting a segment of pie chart, you need to change the selectionMode property of the chart to ‘Point’, as shown in the demo below:

    https://jsfiddle.net/8Lvb6w5k/

  • Posted 26 March 2019, 11:10 am EST

    Thanks

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels