The series-custom.renderItem.return_rect.info look like can't work!
See original GitHub issueVersion
5.2.1
Steps to reproduce
const myChart = echarts.init(document.getElementById('main'));
const option = {
xAxis: {
type: 'value',
},
yAxis: {
type: 'value',
},
series: [
{
type: 'custom',
data: [[1, 2]],
renderItem(params, api) {
return {
type: 'rect',
shape: {
x: 100,
y: 100,
width: 100,
height: 100,
},
info: { a: '23' },
style: {
fill: 'red',
},
}
}
}
]
}
myChart.setOption(option);
myChart.on('click', params => {
console.log(params.info);//When i click the rect,i get undefined.
})
What is expected?
series-custom.renderItem.return_rect.info; console:{ a: ‘23’ }
What is actually happening?
params.info is undefined; The same as others.(group,circle and so on.)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (2 by maintainers)
Top Results From Across the Web
ReactNative Flatlist - RenderItem not working - Stack Overflow
Reason is that, every object in the data array is referenced through item property of the actual parameter passed to renderItem function.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There will still be this problem in 5.4, when can it be fixed
codePen is here .