We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

OnClientPointRegionClick , retrieve index of the series containing the point that was clicked

Thread ID:

Created:

Updated:

Platform:

Replies:

130255 May 2,2017 08:21 PM UTC May 4,2017 12:17 PM UTC ASP.NET Web Forms 3
loading
Tags: Chart
BFY
Asked On May 2, 2017 08:21 PM UTC

I have a line-graph that contains several series and points in each series

Each series is tied to a unique object, and every point in each series is a specific date with relationship with the object.
When clicking a point I want to redirect user to an URL

To be able to redirect correctly I need to determine both which date (point), I got this with sender.data.region.Region.PointIndex
But I also need to know which series/object the point/date belongs to, how can I retrieve this from the sender-object?

Dharanidharan Dharmasivam [Syncfusion]
Replied On May 3, 2017 12:53 PM UTC

Hi Viktor, 

Thanks for contacting Syncfusion support. 

We have analyzed your query. You can able to get the series index, point index, x and y values of data points from pointRegionClick event. We have prepared a sample with respect to this scenario and displayed series index, point index, x and y values in an alert box. Also depends upon the points, we have navigated to another URL link. Find the code snippet below. 

ASP.Net: 

<ej:Chart OnClientPointRegionClick="pointClick"> 
</ej:Chart> 
 
function pointClick(sender) { 
            //Get series index and point index 
            var seriesIndex = sender.data.region.SeriesIndex, 
                pointIndex = sender.data.region.Region.PointIndex; 
 
            alert("Series Index : " + seriesIndex + "\nPoint Index : " + pointIndex + "\nX : " +   
                        sender.model.series[seriesIndex].points[pointIndex].x + 
                        "\nY : " + sender.model.series[seriesIndex].points[pointIndex].y); 
 
            //Navigated to URL depends upon points 
            if (pointIndex == 0) 
                window.location = 'https://www.syncfusion.com/'; 
            else if (pointIndex == 1) 
                window.location = 'http://asp.syncfusion.com/demos/web/'; 
            else if (pointIndex == 2) 
                window.location = 'https://help.syncfusion.com/'; 
            else if (pointIndex == 3) 
                window.location = 'http://mvc.syncfusion.com/demos/web/'; 
            else if (pointIndex == 4) 
                window.location = 'https://help.syncfusion.com/api/js/global'; 
            else if (pointIndex == 5) 
                window.location = 'https://help.syncfusion.com/api/js/ejchart'; 
             
        } 

Screenshot: 
 

Sample for reference can be find from the below link. 
 
Thanks, 
Dharani. 


BFY
Replied On May 3, 2017 07:44 PM UTC

Thank you!
Exactly what I was looking for

Dharanidharan Dharmasivam [Syncfusion]
Replied On May 4, 2017 12:17 PM UTC

Hi Viktor 
   
Thanks for your update. 
 
Kindly revert us, if you need further assistance. 
   
Thanks,  
Dharani.  


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;