Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

V5版本设置使用回调函数设置style,回调函数参数错误 #5936

Closed
chi-gao opened this issue Dec 14, 2023 · 1 comment
Closed

Comments

@chi-gao
Copy link

chi-gao commented Dec 14, 2023

问题描述

我使用最新版本的G2绘制图表时,发现使用回调函数动态设置style时,回调函数的三个参数都返回了整个数组,而不是单个项目的值。与文档不一致。
文档链接:https://g2.antv.antgroup.com/manual/core/style
image

重现链接

https://codesandbox.io/p/sandbox/bold-glitter-wpyx6l?file=%2Findex.ts%3A26%2C45

重现步骤

运行Demo,可以参考下console.log打印出来的值。
image

预期行为

我理解回调函数应该作用于数组中的每一项, 基于单项中的特定值设置不同的样式, 而不是作用于整个数组。

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

@hustcc
Copy link
Member

hustcc commented Dec 15, 2023

柱形图返回的是数组每一项,折线图返回的是数组,因为折线图的一条线是数组中的数据绘制的。

@antvis antvis locked and limited conversation to collaborators Dec 15, 2023
@hustcc hustcc converted this issue into discussion #5938 Dec 15, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants