log axis in line chart - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

log axis in line 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"> 
   </head> 
   <body> 
      <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> 
      <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> 
      <button id="button" class="autocompare">Set new data</button> 
      <script type="text/javascript">
var highchart = Highcharts.chart('container', {
    title: {//from   w  ww . j a v  a 2 s  .c  o  m
        text: 'Logarithmic axis demo'
    },
    tooltip: {
        headerFormat: '<b>{series.name}</b><br />',
        pointFormat: 'x = {point.x}, y = {point.y}'
    },
    series: [{
        data: [256, 512],
      }]
});
$('#button').click(function () {
    highchart.series[0].setData([1, 2, 4, 8, 16]);
    highchart.xAxis[0].setCategories(['J', 'F', 'M', 'A', 'M']);
});
//highchart.series.setData([1, 2, 4, 8, 16]);
//highchart.xAxis[0].setCategories()

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

Related Tutorials