echarts饼状图样式在哪里调
ECharts饼状图样式可以在option中的series中进行设置。具体设置项包括:
- center:设置饼状图的中心位置
- radius:设置饼状图的半径
- label:设置饼状图每个扇形的标签样式
- itemStyle:设置饼状图每个扇形的样式,包括颜色、阴影等
- emphasis:设置饼状图鼠标悬浮在扇形上时的样式
下面是一个示例代码:
option = {
series: [{
type: 'pie',
center: ['50%', '50%'],
radius: [0, '60%'],
label: {
show: true,
position: 'outside',
formatter: '{b} {d}%'
},
itemStyle: {
borderRadius: 5,
borderColor: '#fff',
borderWidth: 2,
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
},
data: [
{value: 335, name: '直接访问'},
{value: 310, name: '邮件营销'},
{value: 234, name: '联盟广告'},
{value: 135, name: '视频广告'},
{value: 1548, name: '搜索引擎'}
]
}]
};
原文地址: https://www.cveoy.top/t/topic/bek0 著作权归作者所有。请勿转载和采集!