禁用UTC时区

时间:2017-03-30 07:26:06

标签: highcharts

我正在尝试在高度图中显示UTC时区,但我不知道如何将Highchart中的setOption添加到我的HighChart中的global{useUTC: false}?我想禁用UTC Timezon。

https://jsfiddle.net/LLExL/7281/

1 个答案:

答案 0 :(得分:2)

像这样申请useUTC



Highcharts.setOptions({
  global: {
    useUTC: false
  }
});

Highcharts.chart('container',

  {
    chart: {
      type: 'columnrange',
      inverted: true,
      height: 200,
      spacingLeft: 30
    },
    credits: {
      enabled: false
    },
    title: {
      text: null,
      style: {
        "fontSize": "10px"
      }
    },
    subTitle: {
      text: null
    },
    legend: {
      enabled: false,
    },
    plotOptions: {
      series: {
        pointWidth: 30
      }
    },
    xAxis: {
      min: 1,
      max: 1,
      categories: ['', ''],
      title: {
        text: null
      },
      labels: {
        rotation: 90
      },
      gridLineWidth: 0
    },
    yAxis: {
      type: 'datetime',
      title: {
        text: null
      },
      labels: {
        rotation: -45,
        style: {
          "fontSize": "10px"
        }
      },
      tickInterval: 1800000,
      gridLineWidth: 1
    },
    series: [{
      data: [
        [1, 1483337940000, 1483338000000],
        [1, 1483338300000, 1483339740000],
        [1, 1483340580000, 1483340640000],
        [1, 1483340640000, 1483340820000],
        [1, 1483340820000, 1483341000000],
        [1, 1483342800000, 1483342860000],
        [1, 1483342860000, 1483342920000],
        [1, 1483342920000, 1483342980000],
        [1, 1483346460000, 1483346520000],
        [1, 1483347120000, 1483347180000],
        [1, 1483347180000, 1483348440000],
        [1, 1483348440000, 1483348620000],
        [1, 1483348620000, 1483348740000],
        [1, 1483350180000, 1483350240000],
        [1, 1483350420000, 1483351380000],
        [1, 1483353300000, 1483353420000],
        [1, 1483355280000, 1483355340000],
        [1, 1483358580000, 1483359780000],
      ]
    }]
  }

);

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>

<div id="container">

</div>
&#13;
&#13;
&#13;