<template>
  <echarts :option="option" :loading="loading"></echarts>
</template>

<script>
export default {
  name: 'LineChart',
  props: {
    option: {
      type: Object,
      default: () => ({})
    },
    value: {
      type: Array,
      default: () => []
    },
    loading: Boolean
  },
  computed: {
    opt() {
      return {
        xAxis: {
          type: 'category',
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            type: 'line',
            smooth: true
          }
        ],
        dimensions: ['key', 'value'],
        source: this.value,
        ...this.option,
      }
    }
  },
  data() {
    return {
    }
  }
}
</script>