SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & 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

I’m having some difficulty with the RolloverData PropertyChanged notification. I have attached an event handler based on your code, which is triggered as I mouse over the chart, but the SeriesInfo collection always has a count of 0. The data bound rollover block does update correctly.

Any ideas?

  • You must to post comments
0
0

Hello Alex,

You’re right – I just looked at the RolloverModifier code and it assigns a new (empty) ObservableCollection before filling it with values.

May I ask, why do you need a notification of rollover? There may be another way to achieve what you want.

It’s a bit messy but the following code should get you a notifcation of new Rollover data

this.rolloverModifier.RolloverData.PropertyChanged += (s, e) =>
{
    // Rollover data was changed
    if (e.PropertyName == "SeriesInfo")
    {                
        this.rolloverModifier.RolloverData.CollectionChanged += (c, args) => 
        {
             // SerisInfo was added to the collection
             // NOTE: Be careful to unsubscribe to events as this handler will keep the
             // ObservableCollection alive on GC
        }
    }
};

Another way might be to handle the MouseMove events and RenderedEvent on SciChartSurface itself and testing for new RolloverData here. For instance:

this.sciChartSurface.MouseMove += (s, e) => OnMouseMoveOrRendered();
this.sciChartSurface.Rendered += (s, e) => OnMouseMoveOrRendered();

private void OnMouseMoveOrRendered()
{
    // Test for rollover data here, which is updated on mouse move
    // and on render of new data
    if (this.rolloverModifier.RolloverData.SeriesInfo != null)
    {
        // ... 
    }
}
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.