echart旭日图图例完整代码
时间: 2023-11-28 08:45:23 浏览: 75
以下是一个echarts旭日图的完整代码,其中包含了图例的配置:
```javascript
option = {
series: {
type: 'sunburst',
data: [
{
name: 'Grandpa',
children: [
{
name: 'Uncle Leo',
value: 15,
children: [
{
name: 'Cousin Jack',
value: 2
},
{
name: 'Cousin Mary',
value: 5,
children: [
{
name: 'Jackson',
value: 2
}
]
},
{
name: 'Cousin Ben',
value: 4
}
]
},
{
name: 'Father',
value: 10,
children: [
{
name: 'Me',
value: 5
},
{
name: 'Brother Peter',
value: 1
}
]
}
]
},
{
name: 'Nancy',
children: [
{
name: 'Uncle Nike',
children: [
{
name: 'Cousin Betty',
value: 1
},
{
name: 'Cousin Jenny',
value: 2
}
]
}
]
}
],
label: {
show: false
},
levels: [
{},
{
r0: '40%',
r: '60%',
label: {
position: 'outside',
padding: 3,
silent: false
},
itemStyle: {
borderWidth: 2
}
},
{
r0: '60%',
r: '80%',
itemStyle: {
borderWidth: 2
}
},
{
r0: '80%',
r: '100%',
itemStyle: {
borderWidth: 2
}
}
]
},
legend: {
data: ['Grandpa', 'Uncle Leo', 'Cousin Jack', 'Cousin Mary', 'Jackson', 'Cousin Ben', 'Father', 'Me', 'Brother Peter', 'Nancy', 'Uncle Nike', 'Cousin Betty', 'Cousin Jenny'],
orient: 'vertical',
right: 10,
top: 10,
bottom: 10
}
};
```
阅读全文