<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: ['#11a597', '#ff8366', '#5f54ef'],
    dataset: {
      source: [
        ['date', '在线学习', '协同备课', '同步教研'],
        ['3月', 180, 280, 320],
        ['4月', 260, 210, 270],
        ['5月', 280, 180, 280],
        ['6月', 260, 180, 280],
        ['7月', 310, 0, 0],
        ['8月', 300, 0, 0],
        ['9月', 280, 180, 280],
        ['10月', 250, 300, 270],
        // ['11月', 260, 400, 370],
        // ['12月', 280, 180, 280],
      ],
    },
    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' }, { type: 'bar' }],

  })
})
</script>

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