3

我无法在没有周末的情况下呈现日期时间图表。一个人怎么能做到?

这是示例代码(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 中删除星期日和星期六?

4

2 回答 2

4

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

于 2013-08-08T11:03:04.507 回答
1

原轴仅在 Highstock 中可用。

http://api.highcharts.com/highstock#xAxis.ordinal

于 2013-08-08T11:06:45.673 回答