1金币
本帖最后由 515275362 于 2024-7-22 09:59 编辑
echart想让背景透明,使用透明配置项([backcolor=rgba(245, 246, 249, 0.4)] [backcolor=rgba(245, 246, 249, 0.4)]backgroundColor[backcolor=rgba(245, 246, 249, 0.4)]: [backcolor=rgba(245, 246, 249, 0.4)]'rgba(0, 0, 0, 0)'[backcolor=rgba(245, 246, 249, 0.4)],)之后不起作用,这是为什么。var e = 80;
var option = {
backgroundColor: 'rgba(0, 0, 0, 0)',
title: {
show: true,
text: e + "%",
x: "center",
y: "center",// 通过x,y将标题(进度)定位在圆环中心
textStyle: {
fontSize: "25",
color: "black",
fontWeight: "400",
fontFamily: "DINPro, DINPro-Regular",
},
},
tooltip: {
trigger: "item",
formatter: "{d}%",
show: false,
},
legend: {
orient: "vertical",
x: "left",
show: false,
},
series: {
name: "",
type: "pie",
radius: ["65%", "85%"],
avoidLabelOverlap: true,
hoverAnimation: false,
label: {
normal: {
show: false,
position: "center",
},
emphasis: {
show: false,
},
},
labelLine: {
normal: {
show: false,
},
},
data: [
{
value: e,
name: "",
itemStyle: {
color: "#00F5FF",
},
},
{
value: 100 - e,
name: "",
itemStyle: {
color: " #191970",
},
},
],
},
}
|
最佳答案
查看完整内容
插件也可以做到,把它内部写死的css样式黑掉就好了,如下:
1. 给单元格起个名字,如下
2.页面加载命令里加上js代码,$([/backcolor]'[fgcname="chart"]').find([/backcolor]"div").css([/backcolor]"background", [/backcolor]"transparent"); [/backcolor]如下
|