How to get Series selection in chart in selectionchange handler

Posted by: ed on 24 October 2019, 8:31 pm EST

    • Post Options:
    • Link

    Posted 24 October 2019, 8:31 pm EST

    I have a bar chart with 2 series. When someone clicks on a bar in the chart I want to get the index and the series clicked on. I am able to get the index with this code:

    receiptsChart.selectionChanged.addHandler(function (e) {

    var selectionIndex = e._selectionIndex

    });

    but I haven’t been able to figure out how to get the series selected in this event. I have my selection mode set as follows:

    receiptsChart.selectionMode = wijmo.chart.SelectionMode.Point;

    Thanks for your help. Ed

  • Posted 25 October 2019, 12:45 am EST

    Hello Ed,

    You may get the selected Series using the selection property of the FlexChart. Please refer to the following demo sample for reference.

    https://stackblitz.com/edit/angular-4c3yxd?file=src/app/app.component.ts

    Hope it helps!

    Regards,

    Manish Gupta

  • Posted 25 October 2019, 12:20 pm EST

    Perfect! Thanks Manish

Need extra support?

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

Learn More

Forum Channels