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

const props = defineProps<{
  ecahrtsData: object
}>()

const chartRef = ref()
onMounted(() => {
  echarts.init(chartRef.value).setOption({
  tooltip: {
    trigger: 'axis'
  },
  legend: {
    data: props.ecahrtsData.legend_data,
    textStyle:{
      color:'#ccc',
    }
  },
  grid: {
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true
  },
  xAxis: {
    type: 'category',
    boundaryGap: false,
    data:props.ecahrtsData.xAxis_data,
    
  },
  yAxis: {
    type: 'value'
  },
  series: props.ecahrtsData.series
})
})
</script>

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