Pre loader

How to share Rollover Modifier in multiple charts?


I want to share RolloverModifier in multiple charts I am using these lines of code but it is not sharing Rollover modifier

var rollOver: RolloverModifier? = null
rollOver = RolloverModifier()

val sharedRolloverModifier = sciChartBuilder.newModifierGroup()


  • You must to post comments

Hi there

According to our Android Chart Documentation the correct way to sync modifiers across charts is as follows:

Sharing MotionEventGroup
We need to set MotionEventGroup on the ModifierGroups on both charts. Set this to a string value. It needs to be the same string on both charts to link the charts together.

have you followed our tutorial on Linking Multiple charts and checked the associated code sample to see how to do it?

  • Yura Khariton
    As I said before you can’t use same modifier instance in several charts at the same time. If you want you to reuse modifier you can remove it from previous chart and only then add into another one.
  • Muhammad Bilal
    I am using another way to handle this case, I create an instance of sharedRolloverModifier and use isEnabled property to overcome this problem. On longpress I set isEnabled “true” and onUp I set isEnabled “false” , everything is working fine except when I set isEnabled property as “false” the vertical line of RolloverModifier doesnot disappear from last location. How can I also disappear the vertical line? . I have attached my code below kindly review it and give feedback that is everything is fine in my code because when I use scicharts for more than 5 to 10 minutes in my original app in which my data is coming from API my device becomes heatup and performance becomes slow by time , Is there is some problem in my code or it is some other problem? Thanks
  • Muhammad Bilal
  • Muhammad Bilal
    Is there any solution regarding the above mentioned Rollover modifier problem?
  • Yura Khariton
    As Andrew said solution is to create a separate RolloverModifier for each chart and synchronize them using MotionEventGroup.
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies