<template>
  <section class="chart">
    <def-chart :options="options"></def-chart>
  </section>
</template>

<script lang="ts" setup>
import { reactive } from 'vue'
import * as echarts from 'echarts'
type EChartsOption = echarts.EChartsOption

/* 初始化图表配置 */
const options = reactive<EChartsOption>({
  tooltip: {},
  xAxis: {
    type: 'category',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      data: [120, 200, 150, 80, 70, 110, 130],
      type: 'bar',
      showBackground: true,
      backgroundStyle: {
        color: 'rgba(180, 180, 180, 0.2)'
      }
    }
  ]
})
</script>

<style scoped lang="scss">
.chart {
  width: 600px;
  height: 300px;
}
</style>
