0

I coverted all the x value with Date.parse() function

How could I get my expectation

- change x label and x value as "%Y%m%d" in tooltip
- remove the strange 12:00 empties on x-axis

Thanks

inline

Covert function

  $.each($scope.flights, function() {
      var current_flight_no =  this
      $.each(current_flight_no.data, function(){
        this.x = Date.parse(this.x);
      })
  });

Chart option

options: {
  chart: {
    type: 'scatter'
  },
},
xAxis: {
    type: 'datetime',
    dateTimeLabelFormats: {
        day: '%b %e (%a)',
    },
tooltip: {
    formatter: function () {
        return 'Extra data: <b>' + this.point.price + '</b>';
    }
},
user3675188
  • 7,271
  • 11
  • 40
  • 76

1 Answers1

0

To fix the tooltip issue, use the formatter option:

 formatter: function() {
          return this.y + '<br />' +Highcharts.dateFormat('%Y %M %d', this.x);
        },

The x values are in milliseconds, Highcharts.dateFormat(...) is needed to change milliseconds to regular date

To fix the 12:00, just go with minTickInterval http://api.highcharts.com/highcharts#xAxis.minTickInterval

It will be great if you can share the data to better assist you.

mustapha mekhatria
  • 3,495
  • 1
  • 20
  • 26