• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
斩月飞仙
赚钱使我得到想要的生活,而想要的生活使我快乐,所以四舍五入,约等于赚钱使我快乐
博客园    首页    新随笔    联系   管理    订阅  订阅

echarts水球图编写

// 前提条件 需要引入这个插件
<script src="./echarts-liquidfill.min.js"></script>

// 代码
let Chart = echarts.init(document.getElementById('Chart'));
let option = {
title: { // 水球图标题样式
text: '日',
left: 'center',
bottom: '10%',
textStyle: {
color: '#ffffff',
fontSize: 14
}
},
tooltip: {
show: true
},
series: [
{
name: '日',
type: 'liquidFill', // 水球图样式
center: ['50%', '45%'], // 水球图位置
amplitude: 3, // 波浪波动起伏大小
waveLength: '100%', // 波浪长度
color: ['#3399cc'], // 波浪颜色
backgroundStyle: {
color: '#ffffff', // 内部球背景颜色
borderWidth: 2, // 内部球边框宽度
borderColor: '#e3e3e3' // 内部球边框颜色
},
label:{
normal:{
formatter: '234', // 内部文字内容
textStyle: {
color: '#ffffff', // 在波浪上方时的文字颜色
insideColor: '#ffffff', // 在波浪下方时的文字颜色
fontSize: 10 // 文字大小
}
}
},
outline: {
borderDistance: 0, // 外边框与内边框间的距离
itemStyle: {
borderWidth: 5, // 外边框的宽度
borderColor: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ // 1代表上面 // 外边框的颜色(渐变色)
offset: 0,
color: '#1b6491'
}, {
offset: 1,
color: '#3399cc'
}]),
}
},
data: [0.6] // 水球的注满度 60%
}
]
};
Chart.setOption(option);


 

 这个水球内部的背景,没办法调成纯白色,设置成白色背景还是发灰,不知哪位会调

posted @ 2019-10-29 15:27  斩月飞仙  阅读(2839)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3