echarts饼图参数配置
时间: 2023-08-31 16:08:34 浏览: 250
在echarts中配置饼图的参数包括值域设置和图例设置。值域设置包括设置饼状图的大小、位置和样式,以及设置鼠标放到扇形上时的样式和标签显示内容。图例设置包括设置图例的布局方式、位置、图形大小和颜色,以及设置图例项之间的间隔和背景颜色。
值域设置的示例代码如下:
series: [
{
name: '生源地',
type: 'pie',
radius: ['30%', '60%'],
center: ['50%', '50%'],
data: [{value:335, name:'北京'}, {value:310, name:'上海'}, {value:234, name:'广州'}, {value:135, name:'深圳'}, {value:148, name:'郑州'}],
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(30, 144, 255, 0.5)'
}
},
labelLine: {
normal: {
show: false
}
},
label: {
normal: {
position: 'inner',
formatter: '{c}'
}
}
}
]
图例设置的示例代码如下:
legend: {
orient: 'vertical',
x: 'left',
y: 'center',
itemWidth: 24,
itemHeight: 18,
textStyle: {
color: '#666'
},
itemGap: 30,
backgroundColor: '#eee',
data: ['北京','上海','广州','深圳','郑州']
}
以上是配置echarts饼图的参数的示例代码。根据需要进行相应的修改即可。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [Echarts饼状图属性设置大全](https://blog.csdn.net/sleepwalker_1992/article/details/82532210)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [echarts饼图 配置,及案例](https://blog.csdn.net/qq_41973526/article/details/125180528)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文