Good day!
I need to determine the value of the visible graph y from the x value and the problem is that I can’t calculate the y value outside of the data I’m rendering
example data:
[
{ x:1, y: 10 },
{ x:5, y: -5 },
{ x: 9, y: 15}
]
I use SCISplineMountainRenderableSeries and I need to show the intersection of the graph at point 3.5
I need a point but I have only one coordinate value
how can i get this y value?
- Sergey Evdokimov asked 3 years ago
- last edited 3 years ago
- You must login to post comments
You can perform hit-test programmatically and get Y-Value, like this:
// create SCIHitTestInfo which will hold hit-test info
let info = SCIHitTestInfo()
// Get a coordinate from your X-Point, alternatively pass exact location
let xCoord = xBottomAxis.currentCoordinateCalculator.getCoordinate(1.8)
// perform hit-test
rSeries.verticalSliceHitTest(info, at: CGPoint(x: CGFloat(xCoord), y: 0.0))
// create series info object which will hold values, you are interested in
let seriesInfo = rSeries.seriesInfoProvider.seriesInfo
// update seriesInfo with hit-test info
seriesInfo.update(info, interpolate: true)
// get the Y-Value
print((seriesInfo as? SCISplineXySeriesInfo)?.yValue)
You can find more about Hit-Test API here:
Let us know if it works for you
- Andriy P answered 3 years ago
- You must login to post comments
Hi, there.
You can use one of our modifiers, SCICursorModifier, SCIRolloverModifier or SCITooltipModifier and set its property “useInterpolation” to true, like this:
let cursor = SCICursorModifier()
cursor.useInterpolation = true
And you will get the Y-Point like on the screenshot.
You can find more about Modifiers API here:
Let us know if it works for you.
- Andriy P answered 3 years ago
-
All of this modifiers works only with user interaction like touch, cursor, but i need a static not interaction solution
- You must login to post comments
Please login first to submit.