SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components
I was trying to get the max value on the y axis for the visible window, so that I can manually scale the y axis visible range (so I can control the increments and the y axis maximum). To get the max y data in the window, I’ve written in Kotlin:
var coordinateCalc = xUoAxes.createCoordinateCalculatorFrom(xUoAxes.visibleRange) //get visible range of coordinates var coordMin = coordinateCalc.minAsDouble //debug var var coordMax = coordinateCalc.maxAsDouble //debug var var dataRange = yUoAxes.getAxisById("uoId").dataRange //debug var var test = mapOf("test" to coordinateCalc) //create map for getWindowedYRange, providing the coordinateCalculator var windowedYRangeUo = yUoAxes.getAxisById("uoId").getWindowedYRange(test) //I think this should pass back the same value as dataRange?
However, the getWindowedYRange result is significantly different from dataRange, and while debugging, there is only a single data point in yUoAxes.
I wasn’t sure if I’m using the right function, or if I’m using it incorrectly (or if this is even the correct approach to this problem)?
The are some differences between getDataRange() and getWindowedYRange() methods:
– first one calculates range for entire data set ( even for points which are outside VisibleRange of xAxis ) and second one uses only data which are currently on screen ( uses VisibleRange of xAxis to determine range of point to use for calculation ).
– second one applies GrowBy value specified for YAxis, and getDataRange() just calculates Min/Max bounds of data set without any modification
Please login first to submit.