Quantcast
Viewing all articles
Browse latest Browse all 4841

Re: How to get UI5 Chart selected data set index

Hi Venkat,

 

You can get the legend index and y-value by using the below code in the event handler that you have registered for ChartSelectionEvent:

 

     var meaureIndex = event.srcElement.__data__.ctx.path.mi + 1;

     alert(meaureIndex); //hack for getting legend index

     var selPoint = c.getChartObject().getSelectedPoint();

     alert(selPoint); //selected bar index

     var yValue = c.getChartObject().getYDataValueAt(meaureIndex,selPoint);

     alert(yValue);

 

Using the legend index you should be able to get the legend name.

 

Please note that parts of the above code for getting legend index is a hack (not in i5Chart documentation/reference)

 

Hope this helps!

 

Regards,

Ria


Viewing all articles
Browse latest Browse all 4841

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>