I tried to add the OnSeriesClick to the chart definition and it allows this. When I click a bubble item, args is empty. Should this be supported? The user wants a bubble click to navigate to another page?
Posted on:05 Aug 2021 15:03
Generally speaking, the OnSeriesClick event is supported by the Bubble Chart.
An important point to take into consideration when working with numerical charts (like Bubble, Scatter and Scatter Line) is that they represent two numerical values for the X and Y axes and they do not use categories on the x-axis.
That being said, if in the OnSeriesClick handler you are trying to use "Category" or "CategoryIndex" fields of the ChartSeriesClickEventArgs, you will get null values for them since the Bubble Chart does not actually have categories.
To achieve your desired scenario, you can try the following - in the OnSeriesClick handler get the "DataItem" field of the ChartSeriesClickEventArgs and cast it to your model. Then you can use one of its fields to check what item was clicked and then navigate to the corresponding page.
The example below demonstrates how to get the "Country" field of the clicked chart item. It is displayed in a logger string on top of the chart. You may use it as a reference when configuring the Bubble Chart in your application.
I hope you will find the above information and example useful. Having in mind foregoing, I will now mark this request as "Completed", since the scenario can be achieved with the current setup of the Bubble Chart.
If you run across any further concerns, please let us know. We will be happy to step in and assist.