SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
Hi,
I am using Sci Chart android I want to Share/Link Custom Modifier on Multiple Charts ,
How Can i do that?
Hi there,
I’m not 100% sure what you mean by ‘Share/Link Custom Modifier on Multiple Charts’, but I’ll try to answer.
You can’t share same ChartModifier instance between several charts – you need to create separate instance for each chart.
In most cases if you want share some functionality of ChartModifier between charts so all of them will react on some touch interaction is to create ModifierGroup with shared MotionEventsGroup for all charts and add instance of ChartModifier which you want to share into each group. In this case touch events from one chart will be redirected by that ModifierGroup into ModifierGroups from other charts with same MotionEventsGroup.
If you want to share some state between several custom modifiers then you’ll need to create some other class which represents shared state and pass it to each instance of custom ChartModifier so it can be used. This can be done via constructor or some property or static field etc ( this depends on what you’re trying to achive )
Hope this will help you!
Best regards,
Yura
inner class CustomModifier() : GestureModifierBase()
{
override fun onLongPress(e: MotionEvent?)
{
rSeries?.isVisible = false
}
override fun onUp(e: MotionEvent?)
{
rSeries?.isVisible = true
}
Please login first to submit.