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 2022/02/11 15:06:09 UTC

[GitHub] [echarts] Methodician edited a comment on issue #15488: Display the nearest data of different series in one tooltip.

Methodician edited a comment on issue #15488:
URL: https://github.com/apache/echarts/issues/15488#issuecomment-1036308337


   Found a workable work-around for folks in a similar situation to me...
   
   My sensors emit data every 5 minutes, so I'm rounding the time to the nearest 5 minutes and it works like a charm.
   I map through the readouts for each sensor to create my series. Here is some example code to get you started:
   
   `
    modulesWithReadouts.map(({ name, readouts }) => {
           const series: SeriesOption = {
             name,
             type: 'line',
             data: readouts.map((readout: any) => {
               const coeff = 1000 * 60 * 5; // 5 minutes
               return [
                 new Date(Math.round(readout.timestamp / coeff) * coeff),
                 readout.temperature,
               ];
             }),
           };
           return series;
         });
   `
   


-- 
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: commits-unsubscribe@echarts.apache.org

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