question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The series-custom.renderItem.return_rect.info look like can't work!

See original GitHub issue

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.)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
coder-xiaotiancommented, Dec 6, 2022

There will still be this problem in 5.4, when can it be fixed

0reactions
cx690commented, Jun 23, 2022

codePen is here .

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found