Skip to content Skip to sidebar Skip to footer

Highchart / Highstock Shows Unformated Tooltip Lable When Data Grouping Enabled But Not Used

When using data grouping with datetime in Highcharts / Highstock, there seems to be a problem with the formatting of the tooltip label. When data grouping is actually applied (i.e

Solution 1:

The reason of this issue is that you use moment.js dates instead of timestamps as x values for your points.

I replaced moment.js with standard Date.UTC and Date.now functions (they return timestamps) and everything works as it should:

//create timedatavar data = [];
 var m = Date.UTC(2016);
 var until = Date.now();

 while (m < until) {

   data.push({
     x: m,
     y: Math.floor(Math.random() * 1000)
   });
   m += 15 * 60 * 1000;
 }

Live demo:https://jsfiddle.net/kkulig/dLq34dkt/

Docs reference:https://www.highcharts.com/docs/chart-concepts/axes (Datetime paragraph)

Post a Comment for "Highchart / Highstock Shows Unformated Tooltip Lable When Data Grouping Enabled But Not Used"