水球图组件封装(vue项目中可用) 您所在的位置:网站首页 echarts关系图布局方式 水球图组件封装(vue项目中可用)

水球图组件封装(vue项目中可用)

2023-05-27 04:47| 来源: 网络整理| 查看: 265

水球图组件封装

// 一、下载Echarts图表库和相关依赖文件(以下两种安装方式,可以随意选择) // npm npm i echarts@4 npm i echarts-liquidfill@2

// import echarts from 'echarts' import 'echarts-liquidfill' export default { name: '', props: { one: { type: Number, default: 0 // required: true } }, data() { return { chartsLiquid: '' // 初始化图表 } }, mounted() { this.initLiquidEchart() }, methods: { initLiquidEchart() { setTimeout(() => { this.chartsLiquid = this.$echarts.init(this.$refs['liquidEchart']) // 把配置和数据放这里 this.chartsLiquid.setOption({ series: [{ type: 'liquidFill', radius: '90%', data: [this.one / 100], color: 'rgba(67,209,100,1)', label: { normal: { color: '#000', insideColor: 'transparent', textStyle: { fontSize: 16, fontWeight: 'bold', fontFamily: 'Microsoft YaHei' } } }, outline: { show: true, borderDistance: 5, itemStyle: { borderColor: 'rgba(67,209,100,1)', borderWidth: 2 } }, backgroundStyle: { color: 'rgba(67,209,100,.3)' } }] }) }, 50) } } } .liquidData { width: 140px; height: 140px; }


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有