Cannot find type 'IAxisValueFormatter' in scope

Viewed 193

I am trying to use the library https://github.com/danielgindi/Charts but recently it is giving me a problem in this part:

final class CustomDateFormatter: NSObject, IAxisValueFormatter {

private let dateFormatter = DateFormatter()

override init() {
super.init()
dateFormatter.dateFormat = "MMM-yy"
}

func stringForValue(_ value: Double, axis: AxisBase?) -> String {
let newDate = Calendar.current.date(byAdding: .month, value: Int(value), to: Date())
return dateFormatter.string(from: newDate ?? Date()).lowercased()
}

}

The error is:

Cannot find type 'IAxisValueFormatter' in scope
1 Answers
Related