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

0
0

Hi,
I am using Scichart android ,for Linking Chart Modifiers of Multiple charts I use these lines of code as shown below but it will not synchronize charts on X axis properley sometimes what is the reason ?
Is there is any other method to do that?

ModifierGroup chartModifiers2 = sciChartBuilder.newModifierGroup()
// Setting MotionEventsGroup
.withMotionEventsGroup(“SharedMotionEvents”).withReceiveHandledEvents(true)
.withLegendModifier().withShowCheckBoxes(true).withReceiveHandledEvents(true).build()
.withZoomPanModifier().withClipModeX(ClipMode.ClipAtExtents).withReceiveHandledEvents(true).build()
.withPinchZoomModifier().withReceiveHandledEvents(true).build()
.withZoomExtentsModifier().withReceiveHandledEvents(true).build()
.withRolloverModifier().withReceiveHandledEvents(true).build()
.build();

Version
2.5.0.2608
  • You must to post comments
0
0

Hi there,

Thanks for your question. Usually charts can go out of sync because they are rendered in separate threads and as result one chart can be presented on screen sooner than other, but in the end the should end up in the same position because modifiers in same group receive same events and use same code base so if starting conditions are the same they should end in same state after invoking modifiers. ‘

The only case when few charts in same group can go out of sync if they are different – have different sizes ( this may lead to different scrolling distance because of different amount of data per pixel ) or different modifiers ( e.g. if one chart has modifier which changes VisibleRange and other don’t – this can lead to different end states of chart ).

BTW if you want to synchronize charts to show same VisibleRange on several charts then you can create and assign same range instance for axes which should be synchronized like we do in our Sync multiple charts example. In this case you don’t need to use event groups because if modifier changes VisibleRange in one chart this value will be propagated to another chart.

DoubleRange sharedXRange = new DoubleRange(0d, 1d);
final IAxis xAxis1 = sciChartBuilder.newNumericAxis().withVisibleRange(sharedXRange).build();
final IAxis xAxis2 = sciChartBuilder.newNumericAxis().withVisibleRange(sharedXRange).build();

Best regards,
Yura

  • sci chart
    I use the same method but sometimes in my case synchronization outs. My code is here private val sharedDateRange = DateRange() val xAxis = sciChartBuilder.newDateAxis() .withGrowBy(0.1, 0.1) .withVisibleRange(sharedDateRange) .build() val yAxis = sciChartBuilder.newNumericAxis() .withGrowBy(0.1, 0.1) .withAxisAlignment(AxisAlignment.Left) .build() val chartModifiers = sciChartBuilder.newModifierGroup() // Setting MotionEventsGroup .withMotionEventsGroup(“SharedMotionEvents”).withReceiveHandledEvents(true) .withLegendModifier().withShowCheckBoxes(true).withReceiveHandledEvents(true).build() .withZoomPanModifier().withClipModeX(ClipMode.ClipAtExtents) .withClipModeY(ClipMode.ClipAtExtents).withReceiveHandledEvents(true).build() .withPinchZoomModifier().withReceiveHandledEvents(true).build() .withZoomExtentsModifier().withReceiveHandledEvents(true).build() .withRolloverModifier().withReceiveHandledEvents(true).build() .build()
  • You must to post comments
0
0

Screen Shot

Images
  • Yura Khariton
    Unfortunately it’s hard to say why this happens without seeing the entire code. Can you attach a project which reproduces this issue so I can debug it on my PC?
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.