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.

1
0

Hi guys,

I have two SciCharts, and a different custom modifier on each of them. I have utilised the Mouse:MouseManager.MouseEventGroup=”MySharedMouseGroup” logic to share mouse events between the two charts.

The problem is, I would like Chart A to handle its own MouseMove events, and share those to Chart B, but Chart B should handle its own MouseMove events (and those sent from Chart A obviously) but not send anything back to Chart A’s modifiers.

I have noticed that there are some base properties from UIElement called “IsMouseOver” which should let me handle this (i.e. in Chart B’s OnModifierMouseMove method it could check IsMouseOver and if false, simply return. That way, the message is still being shared between A and B, but B just ignores A’s messages), but unfortunately I find this IsMouseOver property to always be false, no matter where the pointer is.

How would you guys recommend I tackle this problem?

As an example of the problem, let’s say you have two SciCharts, each with their own RolloverModifier, and their ModifierGroup shares a MouseEventGroup “MySharedMouseGroup”.
You want one chart to display a rollover on both surfaces when the Mouse moves over it, but the other to display a rollover on just its own surface when the mouse is over it.

Cheers,
Miles

  • You must to post comments
0
0

Hi Miles,

I have an idea for you! There is a property in the ModifierMouseArgs called IsMaster. When this is true, the modifier triggered the event, else it is getting it from another modifier.

To make use of this, try the following:

// Note: not compiled this, but it demonstrates the principle
public class IgnoresSlaveEventsRolloverModifier : RolloverModifier
{
   public override void OnModifierMouseMove(ModifierMouseArgs e)
   {
      if (e.IsMaster)
      {
          base.OnModifierMouseMove(e);
      }
   }
}

Now register the IgnoresSlaveEventsRolloverModifier on your first chart and use a normal RolloverModifier on the second chart. Mouse over the first chart and both should receive the event, but mouse over the second and only the second should receive the event.

  • bstapylton
    Hi Andrew,Perfect! Two lines of code and my worries are gone. I should have had a more thorough look when exploring the ModifierMouseArgs and base classes before posting this issue.Thanks for your assistance! Miles
  • bstapylton
    Yes, this worked very well - I just throw return if the ModifierMouseArgs is not master (!e.IsMaster) in one of my modifiers and it will only perform it's MouseMove event if you interact directly with it instead of with the other SciChart. This provides exactly the functionality I was after.In fact, I was looking for a way to do this by using one of the base class properties called IsMouseOver to determine if the mouse is over the current control or not (and if not, I would assume it was not the Master and return).Thanks again, Miles
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.