TheBook
TheBook

Reputation: 1708

Disable the UTC timezone

I am trying to display the UTC Time zone in the hightchart but I do not know how to add the setOption in the Highchart to global{useUTC: false} in my HighChart? I want to disable the UTC Timezon.

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

Upvotes: 0

Views: 2893

Answers (1)

Deep 3015
Deep 3015

Reputation: 10075

Apply like this 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>

Upvotes: 4

Related Questions