Vue3 水球图
2026/6/11 22:26:45 网站建设 项目流程

效果图:

<template> <v-chart ref="vChartRef" :option="option" style="background-color: #000;"></v-chart> </template> <script setup lang="ts"> import { ref } from "vue"; import VChart from "vue-echarts"; import { use } from "echarts/core"; import "echarts-liquidfill"; import { CanvasRenderer } from "echarts/renderers"; import { GridComponent } from "echarts/components"; use([CanvasRenderer, GridComponent]); // 获取图表实例 const vChartRef = ref(); const chartData = ref({ value: 60, }); const option = ref({ series: { type: "liquidFill", shape: "circle", //rect、roundRect、triangle、diamond、pin、arrow radius: "90%", data: [chartData.value.value / 100], center: ["50%", "50%"], color: [ { type: "linear", x: 0, y: 0, x2: 0, y2: 1, colorStops: [ { offset: 0, color: "#446bf5", }, { offset: 1, color: "#2ca3e2", }, ], globalCoord: false, }, ], backgroundStyle: { borderWidth: 1, color: "rgba(51, 66, 127, 0.7)", }, label: { normal: { textStyle: { fontSize: 50, color: "#fff", }, }, }, outline: { show: false, borderDistance: 10, itemStyle: { borderWidth: 2, borderColor: "rgba(6, 116, 241, 0.4)", // shadowBlur: 10, // shadowColor: "rgba(6, 116, 241, 1)", }, }, }, }); </script>

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询