set first category on Y-axis in a line chart? - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

set first category on Y-axis in a 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://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
      <script type="text/javascript">
$(function () {/*from w ww .j av  a2  s  .co  m*/
    var chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
            type: 'line',
            marginLeft: 30
        },
        title: {
            text: null
        },
        legend: {
            enabled: false
        },
        xAxis: {
            type:'datetime',
            tickLength: 2,
            minPadding:0,
            startOnTick:true
        },
        yAxis: {
            lineWidth: 1,
            tickWidth: 1,
            tickPosition: 'inside',
            tickLength: 2,
            min: 0,
            max: 200,
            tickInterval: 50,
            gridLineWidth: 0
            /*,offset:-26*/
        },
        plotOptions: {
            line: {
                marker: {
                    enabled: false
                }
            }
        },
        series: [{
            data: [[Date.UTC(1990,0,1,0,0,0),100], [Date.UTC(1991,0,1,0,0,0),125], [Date.UTC(1992,0,1,0,0,0),150], [Date.UTC(1993,0,1,0,0,0),125], [Date.UTC(1994,0,1,0,0,0),90]]
        },{
            data: [[Date.UTC(1990,0,1,0,0,0),100], [Date.UTC(1991,0,1,0,0,0),80], [Date.UTC(1992,0,1,0,0,0),90], [Date.UTC(1993,0,1,0,0,0),80], [Date.UTC(1994,0,1,0,0,0),70]]
        },{
            data: [[Date.UTC(1990,0,1,0,0,0),100], [Date.UTC(1991,0,1,0,0,0),90], [Date.UTC(1992,0,1,0,0,0),80], [Date.UTC(1993,0,1,0,0,0),60], [Date.UTC(1994,0,1,0,0,0),180]]
        }]
    });
});

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

Related Tutorials