update the data in line chart for both x axis and y axis? - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

update the data in line chart for both x axis and y axis?

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>TryGraph</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-git.js"></script> 
      <style id="compiled-css" type="text/css">

#container {//from   w  w w. jav a  2s .c o  m
   min-width: 300px;
   max-width: 800px;
   height: 300px;
   margin: 1em auto;
}


      </style> 
      <script type="text/javascript">
    $(function(){
var xlast = 20;
var xfirst = 0;
var ylast = 10;
var yfirst = 9;
$('#container').highcharts({
    title: {
       text: 'Calibration',
                x: -20 //center
    },
    xAxis: {
        title: {
            text: 'X Value'
        },
        categories: [xfirst, xlast]
    },
    yAxis: {
        title: {
            text: 'Y Value'
        },
    },
    series: [{
        name: 'Curve',
        data: [yfirst, ylast]
    }]
});
$('#container').highcharts().series[0].setData([100,200],true);
    });

      </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"></div>  
   </body>
</html>

Related Tutorials