Echarts_MarkLine

by tmtron

HTML

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts-en.min.js"></script>
<div id="main" style="width: 600px;height:400px;"></div>

JavaScript

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

option = {
  xAxis: {
    type: 'category',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {
    type: 'log'
  },
  series: [{
    type: 'line',
    data: [120, 200, 150, 80, 70, 110, 130],
    markLine: {
      data: [
        [{
          name: 'start',
          coord: [0, 50],
          label: {
            formatter: name,
            position: 'end'
          },
          lineStyle: {
            color: 'blue'
          }
        }, {
          name: 'end',
          coord: [1, 500],
          symbol: 'rect',
        }]
      ]
    }
  }]
};


myChart.setOption(option);