Latest web development tutorials

Highcharts gráfico logarítmico

Highcharts gráfico Highcharts gráfico

El siguiente ejemplo demuestra una tablas logarítmicas.

En la sección anterior que ya sabemos sintaxis de configuración Highcharts. Veamos cómo configurar.


configuración

YAxis.type configurado como 'logarítmica'. Define el tipo de eje x. Los valores opcionales son "categoría" "lineal", "logarítmica", "fecha y hora" o. El valor por defecto es lineal.

yAxis
var yAxis = {
   type: 'logarithmic',
   minorTickInterval: 0.1
};

Ejemplos

Nombre del archivo: highcharts_line_logarithmic.htm

<html>
<head>
<meta charset="UTF-8" />
<title>Highcharts 教程 | 本教程(w3big.com)</title>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
</head>
<body>
<div id="container" style="width: 550px; height: 400px; margin: 0 auto"></div>
<script language="JavaScript">
$(document).ready(function() {  
   var title = {
      text: '对数实例(w3big.com)'   
   };
   var xAxis = {
      tickInterval: 1
   };
   var yAxis = {
      type: 'logarithmic',
      minorTickInterval: 0.1
   };
   var tooltip = {
      headerFormat: '<b>{series.name}</b><br>',
      pointFormat: 'x = {point.x}, y = {point.y}'
   };
   var plotOptions = {
      spline: {
         marker: {
            enabled: true
         }
      }
   };
   var series= [{
         name: 'data',
         data: [1, 2, 4, 8, 16, 32, 64, 128, 256, 512],
         pointStart: 1
      }
   ];     
      
   var json = {};   
   json.title = title;   
   json.tooltip = tooltip;
   json.xAxis = xAxis;
   json.yAxis = yAxis;  
   json.series = series;
   json.plotOptions = plotOptions;
   $('#container').highcharts(json);
  
});
</script>
</body>
</html>

La salida del ejemplo anterior es:

Highcharts gráfico Highcharts gráfico