
I have created a line graph with Date Time format on X Axis.The values are plotting correctly,but i would like to be shown 1 hour interval based.Right now its showing directly the xvalue as ranges.Can anyone help how to set ranges for this, i am struck for almost a day in this.Thanks
let xAxis = self.chartView.xAxis
xAxis.labelFont = .systemFont(ofSize: 10)
xAxis.labelTextColor = .black
xAxis.drawAxisLineEnabled = false
xAxis.valueFormatter = DateValueFormatter()
public class DateValueFormatter: NSObject, IAxisValueFormatter {
private let dateFormatter = DateFormatter()
override init() {
super.init()
dateFormatter.dateFormat = "HH:mm"
}
public func stringForValue(_ value: Double, axis: AxisBase?) -> String {
return dateFormatter.string(from: Date(timeIntervalSince1970: value))
}
}
@leniyadav i have same issue. have you find any solution?
@shahchirag Still have the issue.Do let me know if you find any solution.Thanks
@shahchirag2110 @leniyadav have you guys found any solution? Thanks
please ask on stack overflow.