var test = document.getElementById('id')
var echart = echarts.init(test)
var option = {
  xAxis: {
    type: 'category',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {
    type: 'value',
  },
  series: [{
    data: [100, 200, 300, 320, 270, 160, 330],
    type: 'line',
    lineStyle: {
      color: 'red' //折线图线条颜色
    }
  }]
};
echart.setOption(option, true)
