<script setup lang="ts">
import * as echarts from 'echarts'

const chartRef = ref()
onMounted(() => {
  echarts.init(chartRef.value).setOption({
    title: {
      text: '结对教师数',
      textStyle: {
        color: '#fff',
      },
    },
    tooltip: {
      trigger: 'item',
    },
    legend: {
      top: '5%',
      right: '5%',
      textStyle: {
        color: '#ccc',
      },
    },
    grid: {
      bottom: '6%',
    },
    color: ['#ff8366', '#5f54ef'],
    dataset: {
      source: [
        ['date', '客座名师', '全科教师'],
        ['2022年3月', 22, 37],
        ['2022年9月', 45, 58],
      ],
    },
    xAxis: {
      type: 'category',
      axisLine: {
        show: true,

        lineStyle: {
          type: 'dashed',
          color: '#ccc',
        },
      },
    },
    yAxis: {
      axisLine: {
        show: true,
        lineStyle: {
          type: 'dashed',
          color: '#ccc',
        },
      },
      splitLine: {
        show: true,
        lineStyle: {
          type: 'dashed',
          color: '#ccc',
        },
      },
    },
    // Declare several bar series, each will be mapped
    // to a column of dataset.source by default.
    series: [{ type: 'bar' }, { type: 'bar' }],

  })
})
</script>

<template>
  <div ref="chartRef" class="w-full h-full " />
</template>
