HighCharts datetime xAxis没有缺失值(周末) [英] HighCharts datetime xAxis without missing values (weekends)

查看:123
本文介绍了HighCharts datetime xAxis没有缺失值(周末)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在没有周末的情况下呈现日期时间表。如何做到这一点?



以下是示例代码( http://jsfiddle.net/LLExL/1720/ ):

  $('#container')。 highcharts({
xAxis:{
类型:datetime,
序数:true,
dateTimeLabelFormats:{
day:'%a'
}
},
系列:[{
data:[
[1375221600000,180.45999999999998],
[1375308000000,144.368],
[1375394400000,108.27599999999998] ,
[1375653600000,72.184],
[1375740000000,36.092],
[1375826400000,0]
]
}]
});

正如您所看到的,我正在尝试从highstocks中选择有序选项。您可以在highcharts uservoice中看到它可以用于高图:在基本图表中,可以通过将ordinal设置为true来启用它。从 http:// highcharts.uservoice.com/forums/55896-general/suggestions/1089981-allow-irregular-datetime-xaxis-note-irregular-po



所以,如何在HighCharts中从xAxis中删除星期日和星期六的任何建议?

解决方案

Highcharts 不支持序数轴。此功能是Highstock的一部分,需要使用Highstock lbrary。使用Highstock时,您可以通过调用 new newstock.StockChart()和基本图表通过调用 new new Highstock.Chart()

I am unable to render datetime chart without weekends. How can one do it?

Here is sample code (http://jsfiddle.net/LLExL/1720/):

$('#container').highcharts({
  xAxis: {
    type: "datetime",
    ordinal: true,
    dateTimeLabelFormats: {
      day: '%a'
    }
  },
  series: [{
    data: [
      [1375221600000, 180.45999999999998],
      [1375308000000, 144.368],
      [1375394400000, 108.27599999999998],
      [1375653600000, 72.184],
      [1375740000000, 36.092],
      [1375826400000, 0]
    ]
  }]
});

As you can see, I am trying "ordinal" option from highstocks. You can see in highcharts uservoice, that it could work for highcharts too: "In basic charts it can be enabled by setting ordinal to true." from http://highcharts.uservoice.com/forums/55896-general/suggestions/1089981-allow-irregular-datetime-xaxis-note-irregular-po

So, any suggestions how to remove sunday and saturday from xAxis in HighCharts?

解决方案

Highcharts doesn't support ordinal axis. This feature is part of Highstock and require Highstock lbrary to be used. When using Highstock, you are able to create stock charts by calling new Highstock.StockChart() and basic charts by callling new Highstock.Chart().

这篇关于HighCharts datetime xAxis没有缺失值(周末)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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