# Calculate value for y by x with SCISplineMountainRenderableSeries

### Welcome to the SciChart Forums!

• Some reputation is required to post answers. Get up-voted to avoid the spam filter!
• We welcome community answers and upvotes. Every Q&A improves SciChart for everyone
0
1

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?

Version
3.1.1.5312
Images
• You must to post comments
0
0

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.

Images
• All of this modifiers works only with user interaction like touch, cursor, but i need a static not interaction solution
• You must to post comments
0
0

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

• You must to post comments
Showing 2 results