2016-03-09 39 views
0

我coverted所有的x值与Date.parse()函数我怎么会改变X,Y标签和删除空的X酒吧

我怎么可能让我的意料

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

感谢

inline

隐蔽功能

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

图表选项,

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

如果可能的话给我们提琴 –

回答

0

要解决的提示问题,请使用格式化选项:

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

X值以毫秒为单位,Highcharts.dateFormat(...)是需要将毫秒更改为正常日期

要修复12:00,只需使用minTickInterval http://api.highcharts.com/highcharts#xAxis.minTickInterval

这将是巨大的,如果你可以共享数据,以更好地帮助你。

相关问题