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

Extract the chart colours ? #44

Closed
aerohh opened this issue Mar 30, 2023 · 2 comments
Closed

Extract the chart colours ? #44

aerohh opened this issue Mar 30, 2023 · 2 comments
Assignees

Comments

@aerohh
Copy link

aerohh commented Mar 30, 2023

Does the library allow us to extract the colours used by the chart for each category (category:name in the data) ?

@zhiqingchen
Copy link
Member

try

var option = myChart.getOption();

@aerohh
Copy link
Author

aerohh commented Mar 30, 2023

I've tried it and the following works for me.

myChart.getVisual(
  {dataIndex: index},
  'color'
)

where index is the index of items in series > data.

@aerohh aerohh closed this as completed Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants