You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have bunch of data that have dates on it with following format for example "9 Jan 12:00", "9 Jan 12:05", "9 Jan 12:10" etc. More accurately its in raw format and Im using NSNumberFormatter to get it in right format.
For example Dates = ["8 Jan 14:15", "9 Jan 12:00", "9 Jan 12:05", "9 Jan 12:10", "10 Jan 12:00", "10 Jan 12:05", "10 Jan 12:10", etc..] Basically bunch of data
The problem is that the X axis plotting wrong interval. It starts plots "8 Jan 14:15", "9 Jan 06:55" etc.
I want it to start with "9 Jan 12:00", "9 Jan 18:00", "10 Jan 12:00", "10 Jan 18:00", "11 Jan 12:00", etc..
The text was updated successfully, but these errors were encountered:
Use DefaultAxisValueFormatter.
charView.xAxis.valueFormatter = DefaultAxisValueFormatter.with(block:{
(value, axis) ->String in
//value is time interval
let date = Date(timeIntervalSince1970: value)
let dateFormatter = DateFormatter()
return dateFormatter.date(from: date)
})
You can also write dateFormatter as extension
I have bunch of data that have dates on it with following format for example "9 Jan 12:00", "9 Jan 12:05", "9 Jan 12:10" etc. More accurately its in raw format and Im using NSNumberFormatter to get it in right format.
For example Dates = ["8 Jan 14:15", "9 Jan 12:00", "9 Jan 12:05", "9 Jan 12:10", "10 Jan 12:00", "10 Jan 12:05", "10 Jan 12:10", etc..] Basically bunch of data
The problem is that the X axis plotting wrong interval. It starts plots "8 Jan 14:15", "9 Jan 06:55" etc.
I want it to start with "9 Jan 12:00", "9 Jan 18:00", "10 Jan 12:00", "10 Jan 18:00", "11 Jan 12:00", etc..
The text was updated successfully, but these errors were encountered: