如何在highchart.js中构建图表,其中xAxis(毫秒)和yAxis(天)



我在highchart.js中构建图表时遇到问题。我需要一个条形图,我有一个以毫秒为单位的数组。我需要如何调整我的yAxis,使其以格式(MM:SS)显示数据?

我读了http://stackoverflow.com/questions/18463287/timeline-yaxis-format-with-minutesseconds-only,但它并没有解决我的问题。

Fiddle示例:http://jsfiddle.net/abruilo/uoqwm9cn/请注意yAxis数据。我该怎么改?

谢谢。

您可以在Highcharts.dateFormat().中使用labels.formatter和返回日期

yAxis: {
  type: 'datetime',
  labels:{
    formatter:function(){
        return Highcharts.dateFormat('%H:%M',this.value);
    }
  }
},

http://jsfiddle.net/jrstm7ga/

最新更新