Reputation: 699
I have integrated the antd charts treemap and its looking really bad
Upvotes: 3
Views: 1411
Reputation: 699
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
},
Upvotes: 0
Reputation: 905
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
}
}
Upvotes: 3