Exemplo n.º 1
0
 Meteogram.prototype.tooltipFormatter = function (tooltip) {
 
     // Create the header with reference to the time interval
     var index = tooltip.points[0].point.index,
         ret = '<small>' + Highcharts.dateFormat('%A, %b %e, %H:%M', tooltip.x) + '-' +
             Highcharts.dateFormat('%H:%M', tooltip.points[0].point.to) + '</small><br>';
 
     // Symbol text
     ret += '<b>' + this.symbolNames[index] + '</b>';
 
     ret += '<table>';
 
     // Add all series
     Highcharts.each(tooltip.points, function (point) {
         var series = point.series;
         ret += '<tr><td><span style="color:' + series.color + '">\u25CF</span> ' + series.name +
             ': </td><td style="white-space:nowrap">' + Highcharts.pick(point.point.value, point.y) +
             series.options.tooltip.valueSuffix + '</td></tr>';
     });
 
     // Add wind
     ret += '<tr><td style="vertical-align: top">\u25CF Wind</td><td style="white-space:nowrap">' +
         ' (' + Highcharts.numberFormat(this.windSpeeds[index], 1) + ' m/s)</td></tr>';
 
     // Close
     ret += '</table>';
 
 
     return ret;
 };
Exemplo n.º 2
0
const formatAllNumber = function(value) {
  const arrSplit = (''+value).split('.')
      , decimal = arrSplit[1]
          ? arrSplit[1].length
          : 0;
  return Highcharts
    .numberFormat(value, decimal, '.', ' ');
}
Exemplo n.º 3
0
ChartConfig.fnNumberFormat = function(value){
  const arrSplit = (value+'').split('.')
      , decimal = ( arrSplit[1] )
          ? arrSplit[1].length
          : 0;

  return Highcharts.numberFormat(value, decimal, '.', ' ');
}
Exemplo n.º 4
0
 formatter: function() {
   return '<b>' + this.series.name + '</b><br/>' +
     Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '.' + new Date(this.x).getMilliseconds() + '<br/>' + Highcharts.numberFormat(this.y, 2)
 }