Force min/max in chart and avoid 0 for min - Javascript highcharts

Javascript examples for highcharts:Chart Configuration

Description

Force min/max in chart and avoid 0 for min

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.js"></script> 
      <script type="text/javascript">
    $(function(){/* ww  w .java 2 s. c om*/
$('#chart').highcharts({
    xAxis: {
        labels: {
            rotation: 300,
            y: 20
        },
        categories: ["2014-03-24", "2014-03-25", "2014-03-26", "2014-03-27", "2014-03-28", "2014-03-29", "2014-03-30", "2014-03-31", "2014-04-01", "2014-04-02", "2014-04-03"]
    },
    yAxis: {
        type: 'linear',
        allowDecimals: false,
        reversed: true,
        tickPositions: [1, 50, 100, 150, 200, 250, 300]
    },
    series: [{
        "data": [270, 251, 246, 2, 3, 6, 13, 19, 30, 42, 57]
    }, {
        "data": [69, 64, 64, 1, 2, 4, 8, 11, 15, 16, 25]
    }],
    credits: {
        enabled: false
    },
    exporting: {
        enabled: false
    }
});
    });

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <div id="chart" style="width:800px;height:500px;"></div>  
   </body>
</html>

Related Tutorials