Hello,
I followed the example swiftui-helper-functions to use SciChart in SwiftUI.It works fine.
But when I try to setup majorDelta according to the max data of data series which is from view model, the chart is hang up.
And the preview of Xcode show this error “PreviewUpdateTimedOutError: Updating took more than 5 seconds”.
Here is part of my code , is there something wrong?
private var yAxis: ISCIAxis {
let yAxis = SCINumericAxis()
yAxis.autoRange = .always
yAxis.growBy = SCIDoubleRange(min: 0, max: 0.1)
yAxis.axisAlignment = .left
yAxis.visibleRange = SCIDoubleRange(min: 0, max: viewModel.powerChartModel.powerDataSeries.yMax.toDouble() + PowerView.addVisibleRangeValue)
yAxis.drawMajorBands = false
yAxis.drawMajorGridLines = false
yAxis.drawMinorGridLines = false
yAxis.drawMinorTicks = false
yAxis.autoTicks = false
yAxis.majorDelta = NSNumber(value: round(viewModel.powerChartModel.powerDataSeries.yMax.toDouble() + PowerView.addVisibleRangeValue) * 0.2)
yAxis.minorDelta = NSNumber(value: 1.0)
return yAxis
}
- zhou quan asked 3 years ago
- last edited 3 years ago
- You must login to post comments
Please login first to submit.