Displaying yAxsis data for columnrange highchart

会有一股神秘感。 提交于 2019-12-25 06:13:00

问题


I have a column range highchart . it works fine but it doesn't display time on yAxsis but tooltip does. it is in json format (tooltip time ) .

Any help appreciate ..

my yAxsis looks like this

yAxis: {

  type: 'timepicker',
  labels: {
    formatter: function () { //1262334143000
      return Highcharts.dateFormat('%H:%M %p', this.value);
    }
  },

  title: {
     text: 'Y Sside New'
  }
},

there is this.value it has json date.

Here is the jsfiddle


回答1:


It displays the time in %H:%M:%P (in your JSFiddle), which is hours, minutes and am/pm.

Why does it all say 00:00:am? Because Highcharts has figured that the most reasonable spacing between ticks is some exact number of days, all starting at midnight. To see that they are not all the same you can add day, month, year or similar to the formatter. You can also manually control the tick spacing, if that is desired. See tickInterval in the API and similar yAxis options.

Your formatter isn't selecting when ticks occur, only what text they show. To check this you can do:

yAxis: {
    type: 'datetime',
    labels: {
        formatter: function () {
            return Highcharts.dateFormat('%e. %b %H:%M:%P', this.value);
        }
    },
    title: {
        text: 'Y Sside New'
    }
}

Which adds the day of the month and month name, and you can see that they are different.

See this JSFiddle demonstration.



来源:https://stackoverflow.com/questions/25390410/displaying-yaxsis-data-for-columnrange-highchart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!