Series data dont apply on legend but data exist on series and legend.
- Dominant language
- TypeScript
- Stars
- 67.3k
- Forks
- 19.8k
- Avg merge
- 11d 14h
- Merged PRs (30d)
- 8
Description
The problem is the series set the data and legend set the data but in the end the legend dont show and have an error `Legend data should be same with series name or data name.`
charts varsion: 5.5.1
```js
const option = shallowRef({
legend: {
type: 'scroll',
bottom: '0%',
left: 'center',
},
polar: {
radius: [50, '60%'],
startAngle: 90,
},
angleAxis: {
show: false,
},
radiusAxis: {
show: false,
type: 'category',
},
series: {
name: 'Alarms',
type: 'bar',
roundCap: true,
data: {},
coordinateSystem: 'polar',
label: {
show: false,
},
},
graphic: [
{
type: 'text',
left: 'center',
top: '46%',
style: {
text: 'TOTAL',
textAlign: 'center',
fontSize: 22,
fontWeight: 'normal',
fill: '#6A5ACD',
}
},
{
type: 'text',
left: 'center',
top: '51%',
style: {
text: null,
textAlign: 'center',
fontSize: 22,
fontWeight: 'normal',
fill: '#6A5ACD',
}
}
]
})
onMounted(async () => {
data.value = await fetchData()
const chartData = [
{ name: 'Alarms', value: data.value.alarms, },
{ name: 'Readings', value: data.value.readings, },
{ name: 'Smart', value: data.value.smart, },
]
option.value.series.data = chartData
option.value.legend.data = chartData
option.value.angleAxis.max = data.value.total
option.value.graphic[1].style.text = data.value.total
})
```
Contributor guide
Assessment
This issue has not been assessed yet.