显示columnrange highchart的yAxsis数据 [英] Displaying yAxsis data for columnrange highchart

查看:142
本文介绍了显示columnrange highchart的yAxsis数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个列范围高图。它工作正常,但它不显示时间yAxsis但工具提示。它是以json格式(工具提示时间)。



任何帮助欣赏..



我的yAxsis看起来像这样

  yAxis:{

类型:'timepicker',
标签:{
格式化程序:function(){// 1262334143000
返回Highcharts.dateFormat('%H:%M%p',this.value);
}
},

标题:{
text:'Y Sside New'
}
},

this.value 它有json日期。



这里是jsfiddle

$ 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.

Here is the jsfiddle

解决方案

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆