SwiftChart
SwiftChart copied to clipboard
use of unresolved identifier "value"
I'm trying to implement the touch to show the current value. The problem is that I'm getting use of unresolved identifier "value" when I try to add the text to my label.
The series are shown correctly in the Chart but I'm not getting the value inside the indexes.
func didTouchChart(_ chart: Chart, indexes: [Int?], x: Float, left: CGFloat) {
if dataResponse.count > 0 {
for (seriesIndex, dataIndex) in indexes.enumerated() {
if dataIndex != nil {
// The series at `seriesIndex` is that which has been touched
let value = chart.valueForSeries(seriesIndex, atIndex: dataIndex)
let date = dataDates[dataIndex!]
let type = SensorType.getSpecialCharacter(sensorTypes[dataIndex!])
lblValue.text = "\(value)\(type) \(date)" //Ex. 78°C 12-11-2018
}
}
}
}
It used to work fine before, but I don't know what happened. I don't know what could be happening, I was expecting this behavior.
