You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/08/04 02:18:01 UTC

[GitHub] [incubator-echarts] wlbksy opened a new issue #13073: wrong timestamp parser when xAxis type is 'time'

wlbksy opened a new issue #13073:
URL: https://github.com/apache/incubator-echarts/issues/13073


   ### Version
   4.8.0
   
   ### Steps to reproduce
   following timestamp is around 2020-08-04 10:11:00
   
   ```javascript
   option = {
       xAxis: {
           data: [1596507060, 1596507160, 1596507260], // second
           type : 'time'
       },
       yAxis: {},
       series: [{
           type: 'line',
           data:[220, 182, 191]
       }]
   };
   ```
   
   ```javascript
   option = {
       xAxis: {
           data: [1596507060000, 1596507160000, 1596507260000], // micro second
           type : 'time'
       },
       yAxis: {},
       series: [{
           type: 'line',
           data:[220, 182, 191]
       }]
   };
   ```
   
   ```javascript
   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?
   right parsing of x axis timestamp, timestamp is around 2020-08-04 10:11:00
   
   ### What is actually happening?
   timestamp displays 08:00:00, and wrong xaxis interval
   ![image](https://user-images.githubusercontent.com/2433806/89245594-bbc6bd80-d63b-11ea-8ef1-3832ba5fbc09.png)
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [incubator-echarts] plainheart commented on issue #13073: wrong timestamp parser when xAxis type is 'time'

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #13073:
URL: https://github.com/apache/incubator-echarts/issues/13073#issuecomment-668384775


   It may be not a bug but an incorrect usage. `xAxis.data` is just for the type of `category`. If the type is `time`, it can't be specified.
   > [Category data, available in type: 'category' axis.](https://echarts.apache.org/en/option.html#xAxis.data)
   
   When the type of xAxis is `time`, the time should be specified as a dimension in the `series.data`.
   
   **Example:**
   
   ```js
   option = {
       xAxis: {
           type : 'time'
       },
       yAxis: {},
       series: [{
           type: 'line',
           data:[
               [1596507060000, 220],
               [1596507160000, 182],
               [1596507260000, 191]
           ]
       }]
   };
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [incubator-echarts] plainheart commented on issue #13073: wrong timestamp parser when xAxis type is 'time'

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #13073:
URL: https://github.com/apache/incubator-echarts/issues/13073#issuecomment-668510684


   @wlbksy I'm afraid we can't. For a numerical timestamp, ECharts will parse it to a Date object by `new Date(timestamp)`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [incubator-echarts] wlbksy commented on issue #13073: wrong timestamp parser when xAxis type is 'time'

Posted by GitBox <gi...@apache.org>.
wlbksy commented on issue #13073:
URL: https://github.com/apache/incubator-echarts/issues/13073#issuecomment-668399261


   thanks.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [incubator-echarts] wlbksy closed issue #13073: wrong timestamp parser when xAxis type is 'time'

Posted by GitBox <gi...@apache.org>.
wlbksy closed issue #13073:
URL: https://github.com/apache/incubator-echarts/issues/13073


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [incubator-echarts] echarts-bot[bot] commented on issue #13073: wrong timestamp parser when xAxis type is 'time'

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #13073:
URL: https://github.com/apache/incubator-echarts/issues/13073#issuecomment-668340133


   Hi! We've received your issue and please be patient to get responded. 🎉
   The average response time is expected to be within one day for weekdays.
   
   In the meanwhile, please make sure that **you have posted enough image to demo your request**. You may also check out the [API](http://echarts.apache.org/api.html) and [chart option](http://echarts.apache.org/option.html) to get the answer.
   
   If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical questions.
   
   If you are interested in the project, you may also subscribe our [mail list](https://echarts.apache.org/en/maillist.html).
   
   Have a nice day! 🍵


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [incubator-echarts] wlbksy commented on issue #13073: wrong timestamp parser when xAxis type is 'time'

Posted by GitBox <gi...@apache.org>.
wlbksy commented on issue #13073:
URL: https://github.com/apache/incubator-echarts/issues/13073#issuecomment-668501949


   @plainheart One more question, could we use Standard Unit like seconds as default timestamp unit, instead of javascript's milliseconds?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org