removing decimal places on Y axis with only one point for line chart - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

removing decimal places on Y axis with only one point for line chart

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.9.1.js"></script> 
      <script type="text/javascript">
$(function () {// w ww .j a  v a 2s . c  om
    $('#container').highcharts({
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
                'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },
        yAxis: [{
            tickInterval: 1,
            minRange: 1,
            allowDecimals: false,
            startOnTick: true,
            endOnTick: true
        }, {
            opposite: true
        }],
        series: [{
            data: [2.933]
        }, {
            yAxis: 1,
            data: [1, 2, 3, 4]
        }]
    });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <script src="https://code.highcharts.com/modules/exporting.js"></script> 
      <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>  
   </body>
</html>

Related Tutorials