nook24 commented on issue #14453:
URL: https://github.com/apache/echarts/issues/14453#issuecomment-2343123310

   I have resolved this using [Luxon](https://moment.github.io/luxon/)
   
   ```js
   import { DateTime } from "luxon";
   
   const timezone = 'Europe/Berlin';
   
   let chartOption = {
       tooltip: {
           trigger: 'axis',
           formatter: (params) => {
               //console.log(params);
   
               // Maybe add a loop if you want to support multiple gauges in 
one chart/tooltip
               const gauge = params[0];
               const dateTime = 
DateTime.fromISO(gauge.data[0]).setZone(timezone);
               const value = gauge.data[1];
               const seriesName = gauge.seriesName;
               const color = gauge.color;
               const marker = params[0].marker;
   
               const html = `<div class="row">
                   <div class="col-12">
                       ${dateTime.toFormat('dd.MM.yyyy HH:mm:ss')}
                   </div>
                   <div class="col-12">
                       ${marker} ${seriesName} <span class="float-end bold" 
style="color:${color};">${value}</span>
                   </div>
                   </div>`;
   
               return html;
           }
   
       },
       xAxis: {
           type: 'time',
           axisLabel: {
               formatter: (value) => {
                   const dateTime = 
DateTime.fromMillis(value).setZone(timezone);
                   return dateTime.toFormat('dd.LL.yyyy HH:mm:ss');
               }
           },
       }
   };
   
   
   ```


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to