当前位置: 首页 > news >正文

echarts中给饼图加圆点

 

echarts中饼图加圆点 由于找不到怎么设置小圆点,尝试使用scatter散点图的方式,但是定位会出现问题

下面上上面示意图的完整代码如下:

 var data = {'name': '本年冷量','value': [329.2],};var color = ['rgba(45, 82, 216, 1)', '#00B1BF', '#00F7F8']let option = {title: {text: ['{a|' + data.value[0] + '}{b|GJ}','{c|本年冷量}'].join('\n'),textStyle: {rich: {a: {fontSize: 30,color: color[0],fontWeight: 'bold'},b: {fontSize: 16,color: '#000',verticalAlign: 'bottom',padding: [0, 0, 5, 5] // 调整位置},c: {fontSize: 14,color: '#666',padding: [10, 0, 0, 0]}}},left: 'center',top: 'center',itemGap: 0},tooltip: {formatter: function (params) {return '<span style="color: #000;">占比:' + params.value + '%</span>';}},angleAxis: {max: 1000,clockwise: true, // 逆时针// 隐藏刻度线show: false,startAngle: 90,},radiusAxis: {type: 'category',show: true,axisLabel: {show: false,},axisLine: {show: false,},axisTick: {show: false},},polar: [{center: ['50%', '50%'], //中心点位置radius: '90%' //图形大小}],series: [{name: '小环',type: 'gauge',splitNumber: 12,radius: '60%',center: ['50%', '50%'],startAngle: 0,endAngle: 359.9999,axisLine: {show: false},axisTick: {show: true,lineStyle: {color: color[1],width: 3.5,shadowBlur: 1,shadowColor: color[1],},length: 0,splitNumber: 3},splitLine: {show: false},axisLabel: {show: false},detail: {show: false}}, {type: 'bar',z: 10,data: data.value,showBackground: false,coordinateSystem: 'polar',roundCap: true,barWidth: 10,itemStyle: {normal: {opacity: 1,color: new echarts.graphic.LinearGradient(0, 0, 1, 1, [{offset: 0,color: 'rgba(45, 82, 216, 1)'},{offset: 0.85,color: 'rgba(45, 82, 216, 0)'},{offset: 1,color: 'rgba(45, 82, 216, 0)'}]),shadowBlur: 5,shadowColor: '#2A95F9',}},},{type: 'pie',name: '内层细圆环',radius: ['48%', '30%'],startAngle: 90,hoverAnimation: false,clockWise: true,itemStyle: {normal: {color: new echarts.graphic.LinearGradient(1, 0, 0, 1, [{offset: 0,color: 'rgba(45, 82, 216, 0.5)' // 12点方向深色},{offset: 1,color: 'rgba(45, 82, 216, 0.1)' // 回到12点方向完全透明}]),}},tooltip: {show: false,},label: {show: false},data: [100]},],graphic: [{ //2、中心的文字设置type: 'text',z: 100,left: 'center',top: '28%',style: {x: 0,y: 0,fill: 'rgba(45, 82, 216, 1)', // 文字颜色为黑色text: "•",  // 小圆点font: 'bolder 30px "Microsoft YaHei", sans-serif',textAlign: 'center', //3、居中显示stroke: '#fff', // 边框颜色为白色lineWidth: 2,  // 设置边框宽度为2px}}]};

graphic: [{type: 'text',z: 100,left: 'center',top: '28%',style: {x: 0,y: 0,fill: 'rgba(45, 82, 216, 1)', // 文字颜色为黑色text: "•",  // 小圆点font: 'bolder 30px "Microsoft YaHei", sans-serif',textAlign: 'center', stroke: '#fff', // 边框颜色为白色lineWidth: 2,  // 设置边框宽度为2px}}]

简单好用

相关文章:

  • 关于深度学习网络中的归一化BN
  • 【Java面试笔记:实战】41、Java面试核心考点!AQS原理及应用生态全解析
  • 【亲测有效】MybatisPlus中MetaObjectHandler自动填充字段失效
  • 【cv学习笔记】YOLO系列笔记
  • 树莓派5 ubuntu 24.04 docker配置镜像Docker pull时报错:https://registry-1.docker.io/v2/
  • 海外广告投放|FB IG 速推帖子有效吗?
  • 测试过程中有哪些风险?
  • 3.4_1 流量控制、可靠传输与滑动窗口机制
  • 【Spring AI 1.0.0】Spring AI 1.0.0框架快速入门(2)——提示词
  • 简述Python里面search和match的区别
  • 【富士康租赁德克萨斯州工厂以扩大AI服务器产能】
  • Java并发编程实战 Day 20:响应式编程与并发
  • Windows 下安装 NVM
  • Mitsubishi GX Works3 / GOT3 的惡意工程混淆邏輯注入攻擊
  • Kratos 与Golang Cms的关系
  • 工具+服务双驱动:创客匠人打造中医IP差异化竞争力
  • Python 100个常用函数全面解析
  • firebase异常捕获
  • ChatGPT革命升级!o3-pro模型重磅发布:开启AI推理新纪元
  • Python Day49
  • 黄石建设网站/百度推广首页登录
  • .net做网站开发/外贸网站推广平台
  • 茶叶销售网站源代码/营销宣传方式有哪些
  • 深圳优秀网站建设定制/自媒体推广渠道有哪些
  • 苏州网站推广建设/杭州百度seo
  • 做网站ps建立多大的画布/推广软文模板