My problem
I've been struggling with this issue for a few days now. My chart is seeing the values its being provided. I can tell because the range of chart has an upper limit of 60k, but it doesn't seem to be reading my timestamps correctly, so the chart's domain runs from 1 Jan 1970 02:00:00 to 1 Jan 1970 02:00:00 (I'm in GMT+2). So, I am not sure if this is a formatting issue in my schema, or the data that I'm providing.I am using the ASP.NET integration for this.
My schema:
let schema = [{
'name': 'Time',
'type': 'date',
'format': '%Y-%m-%d %I:%-m:%-S'
},{
'name': 'value1',
'type': 'number'
}]
My data:
let data = [
['2023-11-28 10:00:00',60000],
['2023-11-28 10:01:03',59304],
['2023-11-28 10:02:01',59943]
]
My timestamp is in the following format:
2001-01-31 00:00:00.000
Things I have tried
- Appending
.%-L
to my format to account for the milliseconds, but that didn't change anything - Passing the date as a
new Date(date)
in the JSON object - Changing the date format to
2001-01-31T00:00:00
I found what the problem was.
In the database, the format time is formatted
2001-01-31 23:00:59.000
, but when the data is passed to the front, it becomes2001/01/31 23:00:59
.So, from this, the format in the schema has to be
'%Y/%m/%d %I:%-M:%-S'