图表
gitcx
# 新增图表
本项目已经集成,echarts并对他轻度封装,便于使用
# 创建图表组件
<template>
<!--宽高,直接用style写即可-->
<div ref="chartRef"></div>
</template>
<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import { useECharts } from '@/hooks/web/useECharts';
const chartRef = ref<HTMLDivElement | null>(null);
const { setOptions, echarts } = useECharts(chartRef as Ref<HTMLDivElement>);
//这里写 echarts 图表配置 宽高,直接用style写在 <div ref="chartRef"></div> 标签上即可
const option = {
};
onMounted(() => {
setOptions(option as any);
});
</script>