SfAccumulationChart determine segment for mouse click?

Is it possible to capture mouse click (maybe OnPointClick) and determine the segment that was clicked? I only see x,y coordinates and don't know how to relate this to a segment.

3 Replies 1 reply marked as answer

DG Durga Gopalakrishnan Syncfusion Team April 25, 2021 01:48 PM UTC

Hi Martin, 

Greetings from Syncfusion. 

We suggest you to use OnPointClick event to achieve your reported scenario. In the sample, we have printed clicked point X and Y value in console. We have attached sample for your reference. 

Code Snippet 
 
<SfAccumulationChart> 
   <AccumulationChartEvents OnPointClick="PointClickEvent"></AccumulationChartEvents> 
</SfAccumulationChart> 
@code{ 
public void PointClickEvent(AccumulationPointEventArgs args) 
    { 
        Console.WriteLine("X : " + args.Point.X); 
        Console.WriteLine("Y : " + args.Point.Y); 
    } 
} 

Screenshot 

 


Please revert us if you have any concerns. 

Regards, 
Durga G 


Marked as answer

MT Martin Tirion April 29, 2021 03:53 PM UTC

Running the sample made it clear to me. I find the OnPointClick with args.Point.X and Y confusing. Thought it was a real point x,y coordinate. But it's the X- and Y-value of the data. That makes sense. Maybe a suggestion to add a small sample in text in the documentation to make this clear? Just a suggestion :)

Thanks,
Martin


DG Durga Gopalakrishnan Syncfusion Team April 30, 2021 12:38 PM UTC

Hi Martin, 
  
Thanks for an update. We will consider these changes in our documentation and we will include the changes in any of our upcoming release. We will let you know once it is refreshed in online. 
  
Regards, 
Durga G

Loader.
Up arrow icon