Giter Club home page Giter Club logo

Comments (3)

echarts-bot avatar echarts-bot commented on May 22, 2024

@hantongyou It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED

TITLE

[Bug] Treemap sets node border color, thickness, etc. based on node properties

BODY

Version

5.4.3

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=tree-vertical

Steps to Reproduce

  1. I use custom data, but the data format is the same as the data structure of the official website example;
  2. For each of these data items, I set a property to customize the node border style, by setting the following itemStyle configuration item:
...
itemStyle: {  
                        
borderColor: function(params){
                            if(params.data.value>10)
                            return "red";
                            else return "green";
                        }
                    
}
...
  1. After I tried to print params, but nothing was printed, and if I returned "red" directly in borderColor, I didn't succeed in modifying the style, why?

Current Behavior

When rendering a treemap node, the custom modification of the node border style is invalid

Expected Behavior

You can customize the node border style based on the node property values

Environment

- OS:windows 11
- Browser:Chrome 122.0.6261.70
- Framework:React@18.2

Any additional comments?

No response

from echarts.

helgasoft avatar helgasoft commented on May 22, 2024

API says tree.itemStyle.borderColor can be set to a value, not to a function.
See #19606 for customizing trees.

from echarts.

hantongyou avatar hantongyou commented on May 22, 2024

API says tree.itemStyle.borderColor can be set to a value, not to a function. See #19606 for customizing trees.

Thanks, but according to the demo, it can only customizing tree labels but not the nodes' border or nodes color?

from echarts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.