I’m getting the following crash:
2020-02-14 16:45:43.902812-0500 CommonStock Development[2425:710225] -[SCIRolloverModifier onTouchesCancelled:]: unrecognized selector sent to instance 0x282ffe080
2020-02-14 16:45:43.904098-0500 CommonStock Development[2425:710225] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[SCIRolloverModifier onTouchesCancelled:]: unrecognized selector sent to instance 0x282ffe080’
whenever I try to scrub my chart, I must also note that in order for the legend to show, I have to tap really hard on the surface.
This is my code:
func set(data set: SimpleChartDataSet, alternate: SimpleChartDataSet) {
let lineDataSeries = SCIXyDataSeries(xType: .double, yType: .double)
let dashedDataSeries = SCIXyDataSeries(xType: .double, yType: .double)
let group = DispatchGroup()
group.enter()
DispatchQueue.global(qos: .userInteractive).async {
for (index, i) in set.enumerated() {
lineDataSeries.append(x: Double(index), y: Double(i))
}
for (index, i) in alternate.enumerated() {
dashedDataSeries.append(x: Double(index), y: Double(i))
}
group.leave()
}
group.notify(queue: .main) {
let lineSeries = SCIFastMountainRenderableSeries()
lineSeries.zeroLineY = set.min() ?? 0.0
lineSeries.dataSeries = lineDataSeries
lineSeries.strokeStyle = SCISolidPenStyle(color: UIColor.green, thickness: 2.0)
lineSeries.areaStyle = SCILinearGradientBrushStyle(start: CGPoint(x: 0, y: 1), end: CGPoint(x: 0, y: 0), start: UIColor.green, end: UIColor.clear)
let dashedSeries = SCIFastLineRenderableSeries()
dashedSeries.zeroLineY = set.min() ?? 0.0
dashedSeries.dataSeries = dashedDataSeries
dashedSeries.strokeStyle = SCISolidPenStyle(color: UIColor.white, thickness: 2.0, strokeDashArray: [2.0,2.0,2.0,2.0])
SCIUpdateSuspender.usingWith(self.surface) {
self.surface.xAxes.clear()
self.surface.yAxes.clear()
self.surface.renderableSeries.clear()
let xAxis = SCINumericAxis()
xAxis.drawLabels = false
xAxis.drawMajorBands = false
xAxis.drawMajorGridLines = false
xAxis.drawMinorGridLines = false
xAxis.drawMinorTicks = false
xAxis.drawMajorTicks = false
xAxis.drawLabels = false
let yAxis = SCINumericAxis()
yAxis.drawLabels = false
yAxis.drawMajorBands = false
yAxis.drawMajorGridLines = false
yAxis.drawMinorGridLines = false
yAxis.drawMinorTicks = false
yAxis.drawMajorTicks = false
yAxis.drawLabels = false
self.surface.xAxes.add(items: xAxis)
self.surface.yAxes.add(items: yAxis)
self.surface.renderableSeries.add(items: lineSeries, dashedSeries )
self.surface.chartModifiers.add(SCIRolloverModifier())
}
}
}
- jose solorzano asked 4 years ago
- last active 4 years ago