antvis / antvis/G2Plot

🤔 [QUESTION]如何根据分类,自定义legend颜色

Open
#3,202 0 comments 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]
https://g2plot.antv.vision/zh/examples/more-plots/word-cloud#basic
数据
{
"x": "China",
"value": 1383220000,
"category": "asia"
},
在这个例子中,怎么能根据category 自定义传入一个颜色?现在看起来颜色是随机分的

### 💻 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

Start with the G2Plot word-cloud basic example at the linked documentation page and reproduce the sample using the provided g2plot CodeSandbox template. Determine whether the category value can drive a custom legend color; done means the example visibly assigns the requested color by category.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.