Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] series-custom.renderItem.return_polyline. info any 用户定义的任意数据,可以在 event listener 中访问,存在bug #18880

Closed
1t1824d opened this issue Jul 12, 2023 · 2 comments

Comments

@1t1824d
Copy link

1t1824d commented Jul 12, 2023

Version

5.4.2

Link to Minimal Reproduction

https://echarts.apache.org/zh/option.html#series-custom.renderItem.return_polyline.info

Steps to Reproduce

let ItemData = {
type: 'custom',
name: ele.Name,
info: ele.ChartData,
z: ele.ZLevel,
yAxisIndex: ele.YAxisIndex,
silent: false,
invisible: false,
renderItem: (params, api) => {
if (params.context.rendered) {
return;
}
params.context.rendered = true;
let points = [];
for (let i = 0; i < ChartData.length; i++) {
points.push(api.coord(ChartData[i]));
}
return {
type: 'group',
position: [0, 0],
children: [
{
type: "polyline",
shape: {
points: points,
smooth: 1,

                                        },
                                        style: {
                                            fill: ele.FillColor,
                                            stroke: ele.StrokeColor,
                                            lineWidth: ele.LineWidth,
                                            opacity: ele.Opacity,
                                            lineDash: ele.BorderType == "dashed" ? [5, 5] : "",
                                        },

                                        // select: {
                                        //     style: {
                                        //         fill: "#000",
                                        //         stroke: "#000",
                                        //         lineWidth: ele.LineWidth,
                                        //         opacity: ele.Opacity,
                                        //         lineDash: ele.BorderType == "dashed" ? [5, 5] : "",
                                        //     },

                                        // },


                                    },
                                    {
                                        type: 'text',
                                        style: ele.LineLabel ? {
                                            x: points[ele.LineLabelPoinit.X][0],
                                            y: points[ele.LineLabelPoinit.Y][1],
                                            textVerticalAlign: 'bottom',
                                            textAlign: 'center',
                                            text: ele.LineLabel,
                                            textFill: 'red',
                                            fontSize: 16
                                        } : {}
                                    }
                                ]
                            };
                        },
                        clip: true,
                        data: ChartData,
                        markPoint: ele.IsMarkPoint ? markPointCfg : {}
                    }

Current Behavior

info属性无法添加

Expected Behavior

希望自定义系列图形的info属性可以正常使用

Environment

- OS:
- Browser:
- Framework:vue@2

Any additional comments?

No response

@1t1824d 1t1824d added the bug label Jul 12, 2023
@echarts-bot echarts-bot bot added the pending We are not sure about whether this is a bug/new feature. label Jul 12, 2023
@echarts-bot
Copy link

echarts-bot bot commented Jul 12, 2023

@1t1824d It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED

TITLE

[Bug] series-custom.renderItem.return_polyline.info any user-defined arbitrary data, can be accessed in the event listener, there is a bug

@echarts-bot echarts-bot bot changed the title [Bug] series-custom.renderItem.return_polyline. info any 用户定义的任意数据,可以在 event listener 中访问,存在bug [Bug] series-custom.renderItem.return_polyline. info any 用户定义的任意数据,可以在 event listener 中访问,存在bug Jul 12, 2023
@plainheart
Copy link
Member

plainheart commented Jul 12, 2023

#18400 已修复此问题。

@plainheart plainheart added topic: event resolved topic: custom and removed pending We are not sure about whether this is a bug/new feature. labels Jul 12, 2023
@echarts-bot echarts-bot bot closed this as completed Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants