Skip to content

Commit

Permalink
Added fixed background color to pie chart (#1812)
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
  • Loading branch information
bexsoft committed Apr 8, 2022
1 parent 62e270e commit 404a10d
Showing 1 changed file with 21 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ const TenantCapacity = ({
statusClass,
}: ITenantCapacity) => {
const colors = [
"#C4D4E9",
"#DCD1EE",
"#D1EEE7",
"#EEDED1",
"#AAF38F",
"#F9E6C5",
"#8dacd3",
"#bca1ea",
"#92e8d2",
"#efc9ac",
"#97f274",
"#f7d291",
"#71ACCB",
"#F4CECE",
"#D6D6D6",
"#f28282",
"#e28cc1",
"#2781B0",
];

Expand Down Expand Up @@ -88,7 +88,7 @@ const TenantCapacity = ({
}

const plotValues: CapacityValue[] = [
{ value: emptySpace, color: "#D6D6D6", label: "Empty Space" },
{ value: emptySpace, color: "transparent", label: "Empty Space" },
{
value: standardTier.value,
color: standardTierColor,
Expand Down Expand Up @@ -127,6 +127,17 @@ const TenantCapacity = ({
</span>
<div>
<PieChart width={110} height={110}>
<Pie
data={[{ value: 100 }]}
cx={"50%"}
cy={"50%"}
dataKey="value"
outerRadius={50}
innerRadius={40}
fill="#ededed"
isAnimationActive={false}
stroke={"none"}
/>
<Pie
data={plotValues}
cx={"50%"}
Expand All @@ -136,7 +147,7 @@ const TenantCapacity = ({
innerRadius={40}
>
{plotValues.map((entry, index) => (
<Cell key={`cellCapacity-${index}`} fill={entry.color} />
<Cell key={`cellCapacity-${index}`} fill={entry.color} stroke={"none"} />
))}
</Pie>
</PieChart>
Expand Down

0 comments on commit 404a10d

Please sign in to comment.