navigator padding in column chart - Javascript highcharts

Javascript examples for highcharts:Column Chart

Description

navigator padding in column chart

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">

#container {/*w w w . jav  a2 s .c om*/
   padding: 32px;
}


      </style> 
   </head> 
   <body> 
      <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> 
      <script src="https://code.highcharts.com/stock/highstock.js"></script> 
      <script src="https://code.highcharts.com/stock/modules/exporting.js"></script> 
      <div id="container" style="height: 400px, width: 80%"></div> 
      <script type="text/javascript">
$.getJSON('https://www.highcharts.com/samples/data/jsonp.php?filename=aapl-v.json&callback=?', function (data) {
      data = data.slice(0, 90);
    data = data.map(datum => [new Date(datum[0]), datum[1]]);
    data = data.map(datum => [datum[0].toISOString().slice(0,10), datum[1]]);
    // create the chart
    let chart = Highcharts.stockChart('container', {
        chart: {
          type: 'column',
          events: {
             load: function() {
              this.navigator.xAxis.update({
                 minPadding: 0.007,
                maxPadding: 0.007
              });
            }
          }
        },
        rangeSelector: {
            enabled: false
        },
            scrollbar : {
           enabled: true
        },
        title: {
            text: 'AAPL Stock Volume'
        },
        plotOptions: {
            series: {
                groupPadding: 0.2,
                showInNavigator: true
            },
            column: {
                borderRadius: 5,
                pointWidth: 10,
                borderWidth: 1,
                shadow: false
            }
        },
        xAxis: {
            crosshair: true,
            tickLength: 0,
            lineWidth: 0,
            gridLineWidth: 0,
            minPadding: 1,
            labels: {
                x: 0,
                y: 21
            },
            range: 5,
        },
        navigator: {
            enabled: true,
            height: 60,
            maskInside: false,
            shadow: false,
            series: {
               pointPlacement: 'null'
            },
            xAxis: {
                labels: {
                    enabled: false
                },
                startOnTick: true,
                endOnTick: true,
                tickAmount: 0,
                tickPixelInterval: 20,
                minPadding: 0
            }
        },
        series: [{
            data: data,
            navigatorOptions: {
               type: 'column'
            }
        }]
    });
    chart.xAxis[0].setExtremes();
});

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

Related Tutorials