我无法在没有周末的情况下呈现日期时间图表。怎么做到的?
这是示例代码 ( 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]
]
}]
});
如您所见,我正在尝试 highstocks 的“序号”选项。您可以在 highcharts uservoice 中看到,它也适用于 highcharts:“在基本图表中,可以通过将 ordinal 设置为 true 来启用它。”来自 http://highcharts.uservoice.com/forums/55896-general/suggestions/1089981-allow-irregular-datetime-xaxis-note-irregular-po
那么,关于如何从 HighCharts 中的 xAxis 中删除星期日和星期六有什么建议吗?
最佳答案
Highcharts 不支持序数轴。此功能是 Highstock 的一部分,需要使用 Highstock 库。使用 Highstock 时,您可以通过调用 new Highstock.StockChart()
创建股票图表,通过调用 new Highstock.Chart()
创建基本图表。
关于javascript - HighCharts datetime xAxis 没有缺失值(周末),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18107525/