Echarts_LogAxis

by tmtron

HTML

<script src="https://cdn.bootcss.com/echarts/5.1.2/echarts.min.js"></script>
<div id="main" style="width: 600px;height:400px;"></div>

JavaScript

var myChart = echarts.init(document.getElementById('main'));

option = {
  legend: {
    data: ['issue']
  },
  grid: {
    top: 30,
    bottom: 80
  },
    xAxis: {
        type: 'category',
        name: 'x',
        splitLine: {show: false},
        data: ['1', '2', '3', '4', '5', '6', '7', '9', '9']
    },  
  yAxis: {
    type: 'log',
    name: 'y',
    /**
     * test for https://github.com/apache/echarts/issues/10174
     */
    scale: true,
    //min: 1
  },
  series: [{
      name: 'A',
      type: 'line',
      data: [1, 3, 9, 27, 81, 247, 741, 2223, 6669]
    },
    {
      name: 'B',
      type: 'line',
      data: [1, 2, 4, 8, 16, 32, 64, 128, 256]
    },
    {
      name: '1/C',
      type: 'line',
      data: [1 / 2, 1 / 4, 1 / 8, 1 / 16, 1 / 32, 1 / 64, 1 / 128, 1 / 256, 1 / 512]
    }
  ]
};


myChart.setOption(option);