显示columnrange highchart的yAxsis数据 [英] Displaying yAxsis data for columnrange highchart
问题描述
任何帮助欣赏..
我的yAxsis看起来像这样
yAxis:{
类型:'timepicker',
标签:{
格式化程序:function(){// 1262334143000
返回Highcharts.dateFormat('%H:%M%p',this.value);
}
},
标题:{
text:'Y Sside New'
}
},
有 this.value
它有json日期。
$ b $它在
%H:%M:%P
中显示时间(在你的JSFiddle中),这是几小时,几分钟和上午/下午。 为什么说00:00:上午?因为Highcharts认为ticks之间的最合理的间距是确切的天数,所有天都从午夜开始。要看到它们不完全相同,可以在格式化程序中添加日,月,年或类似内容。如果需要,您也可以手动控制滴答间距。请参阅API中的 tickInterval
和类似的yAxis选项。
格式化程序不会在发生滴答时选择,只显示它们显示的文本。要检查这一点,你可以这样做:
yAxis:{
类型:'datetime',
标签: {
formatter:function(){
return Highcharts.dateFormat('%e。%b%H:%M:%P',this.value);
}
},
title:{
text:'Y Sside New'
}
}
其中添加了月份和月份名称的一天,您可以看到它们不同。
请参阅此JSFiddle演示。
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.解决方案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.
这篇关于显示columnrange highchart的yAxsis数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!