把textShadowColor设置成白色或透明都不起作用,运行到小程序端在手机预览小程序时饼图的图例会有阴影,连切换图例的左右箭头那块都有阴影,折线图的就不会有。运行到手机APP 也不会有阴影。
以下是饼图的配置
baseOption = {
tooltip: {
trigger: 'item',
textStyle: {
textShadowBlur: 10, // 关键设置
textShadowColor: 'transparent' // 关键设置
},
formatter: '{a} <br/>{b}: {c} ({d}%)',
position: function (pos, params, el, elRect, size) {
var obj = { top: 10 };
obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 30;
return obj;
},
confine: true
},
legend: {
top: 0,
left: 'center',
orient: 'horizontal',
type: 'scroll', // 图例过多时可滚动
itemWidth: 30,
itemHeight: 16,
backgroundColor: '#ffffff',
itemStyle: {
shadowColor: 'rgba(255, 255, 255, 0.01)',
shadowBlur: 10
},
shadowColor: 'rgba(255, 255, 255, 0.01)',
shadowBlur: 10,
textStyle: {
fontSize: 11,
lineHeight: 16,
overflow: 'break',
textShadowBlur: 10, // 设置阴影模糊大小(值不能为0)
textShadowColor: 'transparent' // 将阴影颜色设置为透明
}
},
series: [{
label: {
position: 'inside',
formatter: '{d}%',
textStyle: {
textShadowBlur: 10, // 关键设置
textShadowColor: 'transparent' // 关键设置
}
},
name: data.name || '数据',
type: 'pie',
radius: '50%',
data: data.series || [],
emphasis: { itemStyle: { shadowBlur: 10, shadowOffsetX: 0, shadowColor: 'rgba(0,0,0,0)' } }
}]
}