SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

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.