Vue中使用echarts-liquidfill绘制水波球

1、插件版本

    "echarts": "^5.3.3",

    "echarts-liquidfill": "^3.1.0",

2、绘制简单的水波球

<template>
  <div ref="liquidfillChart" class="chart-content">暂无数据</div>
</template>
<script>
import * as echarts from 'echarts';
import 'echarts-liquidfill';
export default {
  name: 'liquidfill',
  data() {
    return {};
  },
  mounted() {
    this.draw();
  },
  methods: {
    draw() {
      this.chart = echarts.init(this.$refs.liquidfillChart);
      var option = {
        series: [{
          type: 'liquidFill',
          data: [0.6],
        }]
      };
      this.chart.setOption(option);
    },
  },
};
</script>
<style scoped>
.chart-content {
  width: 100%;
  height: 600px;
  box-sizing: border-box;
  border: 1px solid #ccc;
}
</style>

效果图:

猜你喜欢

转载自blog.csdn.net/sleepwalker_1992/article/details/129167532