Hi,
I am using Sci Chart android I want to Share/Link Custom Modifier on Multiple Charts ,
How Can i do that?
- sci chart asked 5 years ago
-
Is there is any solution regarding this problem?
- You must login to post comments
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
- Yura Khariton answered 4 years ago
-
I created a class in which on onLongPress event I disappear a lineseries which is working fine for one chart but I want to share that event so that if I Longpress on one chart that specific lineseries disappear on all charts not only on that specific chart. How can I do that? The code is below Thanks
-
As shown in Images below
- You must login to post comments
inner class CustomModifier() : GestureModifierBase()
{
override fun onLongPress(e: MotionEvent?)
{
rSeries?.isVisible = false
}
override fun onUp(e: MotionEvent?)
{
rSeries?.isVisible = true
}
- sci chart answered 4 years ago
- last edited 4 years ago
-
Where does rSeries come from? Do you pass it via constructor of CustomModifier or get it dynamically from chart’s RenderableSeries collection?
-
Here is link of Project
- You must login to post comments
Please login first to submit.