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. Image for the cookie policy date

MouseOver on LegendItem

Hi, how can I get a notification when mouse is over a legend item?

1 Reply

MK Muneesh Kumar G Syncfusion Team June 10, 2019 09:11 AM UTC

Hi Adam, 
Greetings from Syncfusion.  
We have analyzed your requirement and you can achieve this by raising MouseMove event in ChartLegend and checking the mouse over element DataContext as per the below code snippet.  
Code snippet 
   <chart:SfChart x:Name="chart" > 
                <chart:ChartLegend MouseMove="ChartLegend_MouseMove" /> 
  private void ChartLegend_MouseMove(object sender, MouseEventArgs e) 
            if(e.OriginalSource is FrameworkElement &&  
                (e.OriginalSource as FrameworkElement ).DataContext is LegendItem) 
Please let us know if you have any other queries.  
Muneesh Kumar G 

Live Chat Icon For mobile
Up arrow icon