Pre loader

Detect MouseEnter on a RenderableSerie

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

Hi,

I try to catch MouseEnter on RenderableSerie to simulate effect on the serie.
But the event is never catch.

ser.MouseEnter += Ser_MouseEnter;

ser.AddHandler(UIElement.MouseEnterEvent, (RoutedEventHandler)OnMouseEnterCallMeAlways);

They are in she SciChartSurface an element than block the route ?

Thanks

  • You must to post comments
0
0

Hi Sylvain,

Please take a quick look at What is a RenderableSeries and what is a DataSeries

Some Notes on RenderableSeries and WPF Standard Features

RenderableSeries are derived from the WPF ContentControl and such can
be styled, themed, however they are not truly visual UIElements in the
sense that WPF visuals are. The RenderableSeries are included in the
Visual Tree so that styling and RelativeSource binding works, however
they are not rendered using the WPF composition engine.

Instead, SciChart uses an alternate, Raster (bitmap) rendering engine
to draw the RenderableSeries as quickly as possible. The alternate
rendering engine means some WPF concepts we are used to no longer
apply, however, the designers of the SciChart API have done their best
to ensure that as many intuitive concepts as possible carry over from
vanilla WPF to SciChart.

Basically, RenderableSeries.MouseEnter is not going to work. Instead, you will need to use our Hit-Test API:

// Subscribed using this code: 
// sciChartSurface.MouseLeftButtonUp += SciChartSurfaceMouseLeftButtonUp;
private void SciChartSurfaceMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
    // Perform the hit test relative to the GridLinesPanel
    Point mousePoint = e.GetPosition(sciChartSurface.GridLinesPanel as UIElement); 
    double datapointRadius = 8;
    bool useInterpolation = false;
    HitTestInfo result = sciChartSurface.RenderableSeries[0].HitTest(mousePoint, datapointRadius, useInterpolation);
 
    // Output results 
    string formattedString =
        string.Format(
            "{6}:\tMouse Coord: {0:0}, {1:0}\t\tNearest Datapoint Coord: {2:0.0}, {3:0.0}\tData Value: {4:0.0}, {5:0.0}",
            mousePoint.X, mousePoint.Y,
            result.HitTestPoint.X, result.HitTestPoint.Y,
            result.XValue, result.YValue,
            result.DataSeriesName);
 
    Console.WriteLine(formattedString);
}

Best regards,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies