SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
Hello!
Tell me what I’m doing wrong?
The error does not always appear (floating error).
In my code, along the stack, it will go to your product
AxisBase2D.js. if !this.parentSurface or visibleSeries is an empty array or !xVisibleRange or !range, then maxRange will also be undefined
The static code analyzer will sound an alarm that there will probably be an attempt to use an uninitialized variable. Do you use static code analyzers?
the problem went away when I commented out yAxis.growBy = new NumberRange (0.35, 0.15)
javascript
createMainYAxis () {
const yAxis = new NumericAxis(this.wasmContext)
yAxis.drawMinorTickLines = false
yAxis.majorGridLineStyle = {
strokeThickness: 1,
color: 'rgba(238, 238, 238, 0.1)'
}
// yAxis.growBy = new NumberRange(0.35, 0.15) // by commenting out this line the error disappears
yAxis.autoRange = EAutoRange.Always
this.mainYAxis = yAxis
this.chartSurface.yAxes.add(yAxis)
},
Hi Roman
Thank you for your feedback on this. It’s a strange error as AxisBase.getWindowedYRange() should not be called unless axis is in a Parent SciChartSurface, but the error only occurs when parent SciChartSurface is undefined.
I’m curious what exact set of circumstances you have in code to get this bug? We never saw it in tests or development.
Best regards,
Andrew
Please login first to submit.