SwiftChart icon indicating copy to clipboard operation
SwiftChart copied to clipboard

use of unresolved identifier "value"

Open OmarJalil opened this issue 6 years ago • 0 comments

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. 660d660e-9adc-11e5-8a67-0c3036c20862

OmarJalil avatar Jan 10 '20 18:01 OmarJalil