Behavior of log axis - Javascript highcharts

Javascript examples for highcharts:Chart Axis

Description

Behavior of log axis

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-3.1.1.js"></script> 
      <script type="text/javascript">
$(function() {//  w w  w . ja  v  a 2 s.c om
  Highcharts.chart('container', {
    title: {
      text: 'Logarithmic axis demo'
    },
    xAxis: {
      tickInterval: 1
    },
    yAxis: {
      type: 'logarithmic',
      min: 9,
      startOnTick: false,
      endOnTick: false,
      tickPositions: [Math.log10(10), Math.log10(20), Math.log10(32), Math.log10(40)]
    },
    tooltip: {
      headerFormat: '<b>{series.name}</b><br />',
      pointFormat: 'x = {point.x}, y = {point.y}'
    },
    series: [{
      data: [1, 2, 4, 8, 16, 32, 64, 128, 256, 512],
      pointStart: 1
    }]
  });
});

      </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