antvis / antvis/G2Plot

饼图设置color的回调如何拿到所有的数据呢?现在只能拿到colorField对应的字段数据。🤔 [QUESTION]

Open
#2,987 1 comment 0 reactions 0 assignees View on GitHub
Question
Dominant language
TypeScript
Stars
2.7k
Forks
591
PR merge metrics
No merged PRs in 30d

Description

### 🐛 Question description [Please make everyone to understand it]
数据格式类似于这样,我想把每条对应的color设置给饼图
` data = [
{ year: '1991', value: 3, color: 'red' },
{ year: '1992', value: 3.4, color: 'yellow' },
{ year: '1993', value: 4, color: 'white' },
]`

`color: (data) => {
console.log(data);
return data.color;
},`
但是回调函数之返回year
![image](https://user-images.githubusercontent.com/32625824/142600251-eac266d2-937e-46d9-8068-2ffa03a87cec.png)

### 💻 Link to minimal reproduction

Please provide a link by forking these links [g2plot](https://codesandbox.io/s/g2plot-reproduction-template-gyej1) or GitHub repo. What is a minimal reproduction, and why is it required?

### 🏞 Expected result

### 🚑 Any additional [like screenshots]

* **G2Plot Version**:
* **Platform**:

Contributor guide

Open the contributing guide

Research direction

The issue provides an inline data example and points to the G2Plot reproduction template, but gives no version, source file, or test. Start by reproducing the pie-chart color callback behavior in that template and trace the callback's datum contract; done means the complete datum behavior is verified in a test or its limitation is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.