Possibility to set specific timezone for time axis
See original GitHub issueWhat problem does this feature solve?
In our case, we have many clients arround the world. We want have the ability to show their data using their timezone. Actually, Echarts use GMT dates to set xAxis intervals labels and current browser timezone for date format.
We correctly set the correct timezone in formatter but, for intervals, we have already the problem of GMT.
It’s a really important feature for us.
What does the proposed API look like?
An option, in xAxis to set timezone should be great to fix the problem :
xAxis : {
type : 'time',
timezone : 'Europe/Paris', // with that, all xAxis times are manipulated using this timestamp
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:6
Top Results From Across the Web
Possibility to set specific timezone for time axis
Hello Everyone, I have an important question/feature asking for Echarts. In our case, we have to works with many timezones to show our...
Read more >Time axis in d3.js with specific time zone - Stack Overflow
Now comes the requirement to show it in a specific time zone (say, 'Asia/Calcutta'). Is there a way to achieve this? The max...
Read more >OJ-Chart: time axis values always displayed adjusted to the ...
Is there a way to display those time values in the horizontal axis adjusted to a specific given timezone?
Read more >Timezone in JavaScript Schedule control - Syncfusion
Apart from the default action of applying specific timezone to the Scheduler, it is also possible to set different time zone values for...
Read more >time.timezone | highcharts API Reference
Since v6.0.5, the time options were moved from the global obect to the time object, and time options can be set on each...
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
I found how to resolve this with
date-fns-tz
:I force the dateTime in UTC but converted in specific timezone using function
utcToZonedTime
. And with that, all showed dates are correctly showed in specific timezone without any problems :We are also looking for something like this. We allow users to set the time zone they want to see and that time zone may be different from the browser’s time. We’re passing in ISO strings for the times and it seems whether I pass in UTC, or specific time zones echarts always (correctly) converts them to the browser’s time zone. We tried to work around this by leaving off the time zone information which mostly works except it does not handle the transition to/from DST as one might expect.
What we would like would be a way to set a time zone for the whole chart, or perhaps per series. All times passed into the data would be displayed and calculated in that time zone rather than the browser’s time zone.
Our fallback solution in the interim is to continue to pass in UTC times and override every tooltip and axis formatter to convert to the time zone the user specified to make it appear like the data is in the right time zone. The only draw back to this approach that I’ve found is that the axis ticks that are chosen are not nice round times like there would normally be (i.e. it chooses to put a tick at what appears to be 3 am instead of midnight).