vue3实现chart水球图

代码如下

js 复制代码
<template>
<div>
<div ref="test" style="width:400px";height="400px"></div>
</div>
</template>
<script>
import * as echarts from 'echarts';
import 'echarts-liquidfill';
export default{
setup(props,content){
let echart = echarts;
    const test = ref(null);
    function initChart(){
        let chart = echart.init(test.value)
        chart.setOption({
            title:{
                text:'',
                subtext:'',
                itemGap:10,
                textStyle:{
                    fontSize:'20',
                    fontWeight:'800',
                    color:'black',
                },
                subtextStyle:{
                    fontSize:'20',
                    fontWeight:'800',
                    color:'black',
                },
            },
        series:[
            {
                type:'liquidFill',
                name:'',
                data:[0.7],
                radius:'70%',
                color:'#73',
                backgroundStyle:{
                    color:'rgba(255,255,255)',
                },
                outline:{
                    show:true
                },
            }
        ],
            // 鼠标进入是否给出提示
            tooltip:{
                show:true,
                formatter: function(params){
                    let tooltipe='<div>123</div>';
                    return tooltipe;
                },
            }
        })
    }
    return{
        test
    };

}
}
</script>
相关推荐
程序员大阳15 小时前
副队长Vue3教程(38)--【练手】基于Vue路由的后台权限演示项目
vue3·路由·登录·项目·权限·后台系统·嵌套路由
程序员大阳17 小时前
副队长Vue3教程 (23)--组件通信:defineExpose暴露属性与方法
vue3·组件通信·difineexpose·暴露属性·暴露方法
程序员大阳18 小时前
副队长Vue3教程(33)--路由懒加载
vue.js·性能优化·vue3·路由·懒加载·速度慢
程序员大阳1 天前
副队长Vue3教程(35)-- 命名路由、嵌套路由、路由元信息
meta·vue3·嵌套路由·命名路由·路由元信息
学以智用1 天前
ECharts5 Option 枚举可选值汇总(只整理**有固定枚举**的配置项,数字/颜色/百分比这类自由值不列入)
echarts
程序员大阳3 天前
副队长 Vue3 教程 (22)--【练手】封装通用分页组件
vue3·组件·分页·封装
程序员大阳4 天前
副队长Vue3教程(31)--【练手】封装useLocalStorage、简易useFetch
vue3·封装·composables·usefetch·组合式函数·uselocalstorage
程序员大阳4 天前
副队长 Vue3 教程(20)--组件defineEmits子传父
vue3·组件·emit·defineemits·子传父
程序员大阳4 天前
副队长Vue3教程(27)--插槽slot:默认插槽与具名插槽
vue3·slot·插槽·具名插槽·默认插槽
程序员大阳4 天前
副队长Vue3教程(30)--组合式函数composables
vue3·实例·composables·组合式函数