how can i add both time and date on x axis in ios charts by Daniel Gindi?
Thanks in advance for the answers!
extension ChartXAxisFormatter: IAxisValueFormatter {
func stringForValue(_ value: Double, axis: AxisBase?) -> String {
if let dateFormatter = dateFormatter {
let date = Date(timeIntervalSince1970: value)
return dateFormatter.string(from: date)
}
return ""
}}
Copyright Notice:Content Author:「user3450687」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/48253885/date-and-time-on-x-axis-in-ios-charts-by-daniel-gindi