wrong timestamp parser when xAxis type is 'time'
See original GitHub issueVersion
4.8.0
Steps to reproduce
following timestamp is around 2020-08-04 10:11:00
option = {
xAxis: {
data: [1596507060, 1596507160, 1596507260], // second
type : 'time'
},
yAxis: {},
series: [{
type: 'line',
data:[220, 182, 191]
}]
};
option = {
xAxis: {
data: [1596507060000, 1596507160000, 1596507260000], // milliseconds
type : 'time'
},
yAxis: {},
series: [{
type: 'line',
data:[220, 182, 191]
}]
};
option = {
xAxis: {
data: [1596507060.000, 1596507160.000, 1596507260.000], // second with decimal
type : 'time'
},
yAxis: {},
series: [{
type: 'line',
data:[220, 182, 191]
}]
};
What is expected?
According to https://echarts.apache.org/en/option.html#series-line.data, timestamp can be used as axis value when type is ‘time’.
right parsing of x axis timestamp, timestamp is around 2020-08-04 10:11:00
What is actually happening?
- timestamp displays
08:00:00
- wrong xaxis interval
- wrong y axis value trending
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
wrong timestamp parser when xAxis type is 'time' · Issue #13073
It may be not a bug but an incorrect usage. xAxis.data is just for the type of category . If the type is...
Read more >timestamp values showing wrong on xaxis in highcharts its ...
You have passed the incorrect time in the x , current x value is 1550862788 if you passed this into to new Date(1550862788)...
Read more >Date/Time label is shown in wrong value on X-Axis - Highcharts
Here I have an issue with the latest Highchart. I am trying to display the data in specified local time zone (for instance,...
Read more >Formatting Dates, Time Series, and Timestamps - Plotly
Learn how to use dates, time series, and timestamp formats with Chart Studio graphs. Chart Studio is the easiest and fastest way to...
Read more >Using a date/time scale - JpGraph
The easiest way to get a date time scale for the X-axis is to use the pre-defined " dat " scale. To be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It may be not a bug but an incorrect usage.
xAxis.data
is just for the type ofcategory
. If the type istime
, it can’t be specified.When the type of xAxis is
time
, the time should be specified as a dimension in theseries.data
.Example:
@wlbksy I’m afraid we can’t. For a numerical timestamp, ECharts will parse it to a Date object by
new Date(timestamp)
.