Pre loader

Sync Multiple Charts Without Syncing Y-Axis Pan

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

Answered
0
0

Android
App version 3.1.1.4423

I am able to sync two charts and receive events between both charts.

However, I wanted to remove the shared y-axis panning between the charts.
I was able to get this working by setting the “withReceiveHandledEvents(false)” linked to the motion event group and setting the “.withYAxisDragModifier().withReceiveHandledEvents(false)”.

However, the current problem being faced, is that, the cursor is now no longer synced between the two charts as if I had “withReceiveHandledEvents(false)” on the motion event group.

I tried using the cursor modifier group, but this did not provide a syncing cursor between the charts.

Is there a way to sync the cursor between the charts without having the y-axis panning synced as well?

Version
3.1.1.4423
  • You must to post comments
Best Answer
0
0

Hi Eyram,

To get desired behavior, you can create 2 ModifierGroups for chart ( ChartModifiers is a collection so it can have multiple entries ) – one with shared events for CursorModifier and another for YAxisDragModifier which shouldn’t be synchronized with other charts:

Collections.addAll(surface.getChartModifiers(),
     sciChartBuilder.newModifierGroup()
           .withMotionEventsGroup("ModifiersSharedEventsGroup").withReceiveHandledEvents(true)
           .withCursorModifier().withReceiveHandledEvents(true).build()
           .build(),
     sciChartBuilder.newModifierGroup()
           .withYAxisDragModifier().withReceiveHandledEvents(true).build()
           .build());

Hope this will help you!

Best regards,
Yura

  • Eyram Dornor
    Hi Yura, That worked! I had “withZoomPanModifier().withReceiveHandledEvents(true).build()” in the group events. This seemed to be the issue. In moving this to the non-shared modifier, the cursor synced appropriately without syncing the y-axis as well.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.