echart的使用

npm install echarts

<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import * as echarts from 'echarts'
import 'echarts-liquidfill'

const people = ref('21211人')
const echartLiquid = ref()

onMounted(()=>{
    const myCharts = echarts.init(echartLiquid.value) //  获取echart的实例
    myCharts.setOption({
        title: { text: '水球图' },
        xAxis: {},
        yAxis: {},
        series: {
            type: 'bar',
            data: [10, 20, 30, 40]
        }
    })
})
</script>
posted @ 2024-04-19 10:28  惊朝  阅读(4)  评论(0编辑  收藏  举报