Skip to content

Commit 404a10d

Browse files
authored
Added fixed background color to pie chart (#1812)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
1 parent 62e270e commit 404a10d

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

portal-ui/src/screens/Console/Tenants/ListTenants/TenantCapacity.tsx

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ const TenantCapacity = ({
3232
statusClass,
3333
}: ITenantCapacity) => {
3434
const colors = [
35-
"#C4D4E9",
36-
"#DCD1EE",
37-
"#D1EEE7",
38-
"#EEDED1",
39-
"#AAF38F",
40-
"#F9E6C5",
35+
"#8dacd3",
36+
"#bca1ea",
37+
"#92e8d2",
38+
"#efc9ac",
39+
"#97f274",
40+
"#f7d291",
4141
"#71ACCB",
42-
"#F4CECE",
43-
"#D6D6D6",
42+
"#f28282",
43+
"#e28cc1",
4444
"#2781B0",
4545
];
4646

@@ -88,7 +88,7 @@ const TenantCapacity = ({
8888
}
8989

9090
const plotValues: CapacityValue[] = [
91-
{ value: emptySpace, color: "#D6D6D6", label: "Empty Space" },
91+
{ value: emptySpace, color: "transparent", label: "Empty Space" },
9292
{
9393
value: standardTier.value,
9494
color: standardTierColor,
@@ -127,6 +127,17 @@ const TenantCapacity = ({
127127
</span>
128128
<div>
129129
<PieChart width={110} height={110}>
130+
<Pie
131+
data={[{ value: 100 }]}
132+
cx={"50%"}
133+
cy={"50%"}
134+
dataKey="value"
135+
outerRadius={50}
136+
innerRadius={40}
137+
fill="#ededed"
138+
isAnimationActive={false}
139+
stroke={"none"}
140+
/>
130141
<Pie
131142
data={plotValues}
132143
cx={"50%"}
@@ -136,7 +147,7 @@ const TenantCapacity = ({
136147
innerRadius={40}
137148
>
138149
{plotValues.map((entry, index) => (
139-
<Cell key={`cellCapacity-${index}`} fill={entry.color} />
150+
<Cell key={`cellCapacity-${index}`} fill={entry.color} stroke={"none"} />
140151
))}
141152
</Pie>
142153
</PieChart>

0 commit comments

Comments
 (0)