Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
How to give custom color to antd charts treemap

enter image description here

I have integrated the antd charts treemap and its looking really bad

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You can assign custom colors... in Chart configuration object add color property like this

config = {
...
    color: ({ name }) => {
      if (name === "分类 10") {
        return "lightblue";
      }
      return "red";
      // return color
    }
}
about 4 years ago · Juan Pablo Isaza Report

0

 color: ({ percentage }) => {
      if (percentage < -3) {
        return "#DC3341";
      }
      if (percentage < -2) {
        return "#B22833";
      }
      if (percentage < -1) {
        return "#80262E";
      }
      if (percentage === 0) {
        return "#1E222D";
      } else if (percentage == 1) {
        return "#1A3326";
      } else if (percentage == 2) {
        return "#80262E";
      } else {
        return "#089950";
      }
      // return color
    },
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!