-
Thanks yura, for your quick response. It resolves my problem. Here I want to add two rollover-modifier to graph at time. I tried to add like this. private var rolloverModifier: CustomRolloverModifier? = null private var rolloverModifier1: CustomRolloverModifier? = null rolloverModifier = CustomRolloverModifier() rolloverModifier!!.setShowTooltip(showTooltip) rolloverModifier!!.setShowAxisLabels(showAxisLabels) rolloverModifier!!.setDrawVerticalLine(drawVerticalLine) rolloverModifier1 = CustomRolloverModifier() rolloverModifier1!!.setShowTooltip(showTooltip) rolloverModifier1!!.setShowAxisLabels(showAxisLabels) rolloverModifier1!!.setDrawVerticalLine(drawVerticalLine) Collections.addAll(surface.chartModifiers, rolloverModifier,rolloverModifier1) but i can see only rollover-modifier on graph.
-
First of all you need to set ReceiveHandledEvent = true for second modifier ( https://www.scichart.com/documentation/android/current/webframe.html#SciChart.Charting~com.scichart.charting.modifiers.ChartModifierCore~setReceiveHandledEvents.html ), because by default if one modifier from modifier collection handles touch event, then others won’t handle them unless they explictly tell that they want to receive touch events that are already handled by other modifiers. This was made to prevent activating several modifiers at the same time. This should allow to show second modifier.
-
BTW in this case both RolloverModifiers will be placed at the same point on screen, because on every touch RolloverModifier is be moved at last touch point ( unless you adjust it ), so you may end up with two overlapping modifiers.
-
I am not able to maintain the gap between two rollover modifiers. Is there any way that i can handle two rollover modifiers on graph by touch event.Hear i tried to add two different custom modifiers but still both rollover modifiers are overlapping each other. I wanted to change the color of vertical line in rollover modifier.
-
Well I told you that they will overlap unless you adjust coords to draw at. You can asjust it’s position by modifier point passed into updateCurrentPoint(https://www.scichart.com/documentation/android/current/webframe.html#SciChart.Charting~com.scichart.charting.modifiers.MasterSlaveTouchModifierBase~updateCurrentPoint.html). To change color try to update color of Paint used to draw vertical line – https://www.scichart.com/documentation/android/current/webframe.html#SciChart.Charting~com.scichart.charting.modifiers.RolloverModifier~getVerticalLinePaint.html, but you need to update it after you add modifier into chart modifier collection, because it will be overriden by chart theme.