Version
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.)
7条答案
按热度按时间5hcedyr01#
Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.
In the meanwhile, please make sure that it containsa minimum reproducible demoand necessaryimagesto illustrate. Otherwise, our committers will ask you to do so.
You may also check out the API and chart option to get the answer.
If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org . Please attach the issue link if it's a technical question.
If you are interested in the project, you may also subscribe to our mailing list .
Have a nice day! 🍵
snz8szmq2#
It also is undefined in tooltip.formatter.
wbrvyc0a3#
Seems to be a bug.
slmsl1lt4#
Seems to be a bug.
5t7ly7z55#
Unfortunately it seems this is still not working? Is there another way of passing data to events?
cs7cruho6#
Unfortunately it is still not work at version 5.3.3
vsdwdz237#
codePen is here .