一、代码

 app.title = '通讯盒各版本用户占比';

 option = {
backgroundColor: '#0f0f31',
title: {
show:true,
x:"left",
text: '通讯盒各版本用户占比',
textStyle:{
fontSize:16
,fontWeight:'normal'
,color:'#72a1d2'
},
left:20,
top:10,
borderColor :'#10395c',
borderWidth :2,
},
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b}: {c} ({d}%)"
},
series: [
{
name:'通讯盒各版本用户占比',
type:'pie',
radius:['10%','18%'],
avoidLabelOverlap:false,
color:['#32A8FF',' #02C800','#9f47fd'],
formatter: '{b}: {d}',
markLine :{
label :{
show:true,
position :'outside'
},
},
labelLine:{
normal:{
length:14 ,
length2 :56,
}
},
label :{
formatter: [
'{d}%',
'{b}'
].join('\n'),
verticalAlign :'bottom',
position:'outside',
//textShadowOffsetY :10,
align :'right',
color:'white',
height :36,
rich: {
a: {
verticalAlign:'bottom',
// 没有设置 `verticalAlign`,则 `verticalAlign` 为 bottom
}
}
}, data:[{value:68,name:'YBT1',label: {
normal: {
textStyle: {
color: '#508DFF' // 改变标示文字的颜色
}
}
},itemStyle:{
normal:{
color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
//颜色渐变函数 前四个参数分别表示四个位置依次为左、下、右、上 offset: 0,
color: '#508DFF'
}, {
offset: 1,
color: '#26C5FE'
}])
}
}},{value:18,name:'YBT2',label: {
normal: {
textStyle: {
color: '#63E587' // 改变标示文字的颜色
}
}
},itemStyle:{
normal:{
color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
//颜色渐变函数 前四个参数分别表示四个位置依次为左、下、右、上 offset: 0,
color: '#63E587'
}, {
offset: 1,
color: '#5FE2E4'
}])
}
}},{value:14,name:'YBT3',label: {
normal: {
textStyle: {
color: '#9f47fd' // 改变标示文字的颜色
}
}
},itemStyle:{
normal:{
color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
//颜色渐变函数 前四个参数分别表示四个位置依次为左、下、右、上
offset: 0,
color: '#9f47fd'
}, {
offset: 1,
color: '#9f47fd'
}])
}
}}]
},{
name:'',
type:'pie',
radius:['8%','10%'],
avoidLabelOverlap:false,
legendHoverLink :false,
label:{
show:false,
},
tooltip:{//禁止鼠标悬停显示提示框
show:false,
},
hoverAnimation:false ,//禁止鼠标悬停放大区域
color:['#bcdbfa'],
data:[{value:'100'}]
}
]
};

二、效果图

利用echarts自定义环形图的更多相关文章

  1. echarts实现环形图

    前端框架使用的angular,使用echarts实现环形图 1. item.component.html <div id="box1" class="pie&quo ...

  2. echarts自定义折线图横坐标时间间隔踩坑总结

    折线图需求:横坐标为时间,要求按一定间隔展示,鼠标移至折线上间隔时间内的数据也可展示 其实很简单的一个配置就可搞定,但在不熟悉echarts配置的情况下,就很懵逼 xAxis: { boundaryG ...

  3. Android中自定义环形图2

    如图: 自定义属性,在values文件夹下创建 attrs.xml <?xml version="1.0" encoding="utf-8"?> & ...

  4. Android中自定义环形图

    如图: 自定义view package com.riverlet.ringview; import android.animation.ObjectAnimator; import android.c ...

  5. echarts画环形图

    alarmManage(){ let drawLine = echarts.init(document.getElementById('data-alarmManage-table-wrap')); ...

  6. Qt编写自定义控件41-自定义环形图

    一.前言 自定义环形图控件类似于自定义饼状图控件,也是提供一个饼图区域展示占比,其实核心都是根据自动计算到的百分比绘制饼图区域.当前环形图控件模仿的是echart中的环形图控件,提供双层环形图,有一层 ...

  7. 修改echarts环形图的牵引线及文字位置

    修改echarts环形图的牵引线及文字位置,下面代码及效果不仅如此,也包含了其它的效果哦.有问题可以留言. 根据echarts官方示例修改效果: 官方示例图: 修改效果图: 直接上代码:其它不多说. ...

  8. vue 结合 Echarts 实现半开环形图

    Echarts 实现半开环形图 1.先看看实现的图 2.HTML部分 创建id 是 chart 的div标签. <div class="content-item"> & ...

  9. echarts白色实心环形图(空心饼图)的编写

    // 数据接入机构统计let myDom = document.getElementById('myChart');let myWidth = myDom.offsetWidth - 5; // 获取 ...

随机推荐

  1. 关于使用Visual编译静态库动态库及其使用的问题

    本文主要讲述了如何使用Visual Studio 2013 编译静态库和动态库,并使用. 一.静态库 1.  编写静态库 若要创建将引用并使用刚创建的静态库的应用程序,请从“文件”菜单中选择“新建”, ...

  2. Linux基础理论

    本节内容 1.  Linux的安装及相关配置 2.  UNIX和Linux操作系统概述 3.  Linux命令及帮助 4.  目录结构 6.  用户.群组和权限 7.  用户.群组和权限的深入讨论 1 ...

  3. Jenkins内置环境变量的使用

    一.查看Jenkins有哪些环境变量 1.新建任意一个job 2.增加构建步骤:Execute shell 或 Execute Windows batch command 3.点击输入框下方的“可用环 ...

  4. Android、JavaScript、WebView之间的交互学习

    一.WebView调用Java //1.允许WebView加载jsmWebView.getSettings().setJavaScriptEnabled(true); //2.编写js的接口 ---- ...

  5. 2.html基础标签:无序+有序+自定义列表

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  6. Android框架式编程之MVP架构

    MVP(Model-View-Presenter)模式.是将APP的结构分为三层:View - Presenter - Model. View 1. 提供UI交互 2. 在presenter的控制下修 ...

  7. web API简介(一):API,Ajax和Fetch

    概述 今天逛MDN,无意中看到了web API简介,觉得挺有意思的,就认真读了一下. 下面是我在读的时候对感兴趣的东西的总结,供自己开发时参考,相信对其他人也有用. 什么是API API (Appli ...

  8. Swift5 语言指南(十一) 结构和类

    结构和类是通用的,灵活的结构,它们成为程序代码的构建块.您可以使用与定义常量,变量和函数相同的语法来定义属性和方法,以便为结构和类添加功能. 与其他编程语言不同,Swift不要求您为自定义结构和类创建 ...

  9. 影响 POST 请求文件上传失败的几个环节的配置(php + nginx)

    写在前面 最近写一个 php 接口,接受上传的文件,发现文件只要超过 5m 以上就会无响应失败,最后发现是 shadowsocks 的 timeout 设置问题(我全程开了全局的 VPN),但一开始并 ...

  10. Typescript 学习笔记一:介绍、安装、编译

    前言 整理了一下 Typescript 的学习笔记,方便后期遗忘某个知识点的时候,快速回忆. 为了避免凌乱,用 gitbook 结合 marketdown 整理的. github地址是:ts-gitb ...