<template>
  <div class="risk-echart">
    <div id="myChart" class="chart-main"></div>
  </div>
</template>
<script>
export default {
  name: 'riskEchart',
  data() {
    return {
      myChart: '',
      option: {
        animation: false,
        xAxis: {
          type: 'category',
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: [820, 932, 901, 934, 1290, 1330, 1320],
            type: 'line',
            smooth: true
          }
        ]
      }
    }
  },
  created() {
    console.log('挂载执行')
    this.init()
  },
  mounted() {

  },
  beforeDestroy() {

  },
  methods: {
    initEchart() {
      console.log('初始化折线图')
      this.myChart = echarts.init(document.getElementById('myChart'), 'shine')
      this.myChart.setOption(this.option)
    }
  }
}
</script>
<style lang="less" scoped>
</style>
