Plot xrange chart in x axis not in the middle - Javascript highcharts

Javascript examples for highcharts:Chart Axis

Description

Plot xrange chart in x axis not in the middle

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <style id="compiled-css" type="text/css">

@import 'https://code.highcharts.com/css/highcharts.css';


      </style> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/js/highcharts.js"></script> 
      <script src="https://code.highcharts.com/js/modules/xrange.js"></script> 
      <div id="container"></div> 
      <script type="text/javascript">
Highcharts.chart('container', {
    chart: {/*w ww. j a  v  a  2 s .  c om*/
        type: 'xrange'
    },
    plotOptions: {
        series: {
            pointPlacement: 'on',
            colors: ["#00e205"],
        }
    },
    series: [{
        name: 'Project 1',
        pointPlacement: -0.5,
        pointWidth: 60,
        // pointPadding: 0,
        // groupPadding: 0,
        data: [{
            x: Date.UTC(2014, 10, 21),
            x2: Date.UTC(2014, 10, 26),
            y: 0
        }, {
            x: Date.UTC(2014, 11, 2),
            x2: Date.UTC(2014, 11, 5),
            y: 0
        }, {
            x: Date.UTC(2014, 11, 6),
            x2: Date.UTC(2014, 11, 8),
            y: 0
        }, {
            x: Date.UTC(2014, 11, 14),
            x2: Date.UTC(2014, 11, 19),
            y: 0
        }, {
            x: Date.UTC(2014, 11, 21),
            x2: Date.UTC(2014, 11, 23),
            y: 0
        }]
    }],
    xAxis: {
        type: 'datetime',
        startOnTick: false
    },
    yAxis: {
        min: 0.45,
        startOnTick: false,
        categories: ['Stampa'],
        labels: {
            enabled: false
        }
    },
    legend: {
        enabled: false
    },
    title: {
        text: 'Plotter'
    }
});

      </script>  
   </body>
</html>

Related Tutorials