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] visualDimension has no effect on treemap #20847

Open
jbdesbas opened this issue Mar 21, 2025 · 2 comments
Open

[Bug] visualDimension has no effect on treemap #20847

jbdesbas opened this issue Mar 21, 2025 · 2 comments
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.

Comments

@jbdesbas
Copy link

Version

5.6.0

Link to Minimal Reproduction

https://codepen.io/jbdesbas/pen/ogNdeBM

Steps to Reproduce

  1. Create a treemap chart with multi-dimension data (eg : data = [{value: [ 100, 50, 'a' ]}, {value: [ 200,50 ,'b' ]}, {value: [ 300,50 ,'b' ]} ]
  2. Try to select dimension to represent (0 or 1)
data= [
  { value:[10,'n1',100,50]},
    {value:[10,'n2',200,50]},
  {value:[10,'n3',300,50]},
  ];
  
option = {
        series:[
            {
                name:"test",
                type:'treemap',
                data: data,
                visualDimension:2,
            }
        ],}

Current Behavior

The visualDimension parameter seems to have no effect, the dimension 0 is always used for area size.

Expected Behavior

The visualDimension parameter should allow to select a dimension as area size.

Environment

- OS:Pop OS
- Browser: Firefox 129.0.2 
- Framework:React@18

Any additional comments?

No response

@jbdesbas jbdesbas added the bug label Mar 21, 2025
@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Mar 21, 2025
@MatthiasMert
Copy link

MatthiasMert commented Mar 21, 2025

You are mistaking what visualDimension does. The documentation suggests that it is used to specify the dimension for coloring, together with colorMappingBy set to 'value'.

@jbdesbas
Copy link
Author

jbdesbas commented Mar 21, 2025

Ok I understand, thank you @MatthiasMert 👍 .
I can now use the visualDimension parameter to use any dimension as color mapping.
But I cannot use discrete category variable (eg : 'n1', 'n2', 'n3') for color mapping. I didn't see anything about that in the documentation.

See here the chart is blank if visualDimension:1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.
Projects
None yet
Development

No branches or pull requests

2 participants