Skip to content

Commit

Permalink
fix:org pie data update
Browse files Browse the repository at this point in the history
Signed-off-by: laixingyou <[email protected]>
  • Loading branch information
coder-sett committed Nov 27, 2023
1 parent c99474e commit 096abdc
Showing 1 changed file with 23 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,31 @@ const ContributorContribution: React.FC<{
const contributorsData = [];
if (data?.orgContributorsOverview?.length > 0) {
const ecoContributorsOverview = data.orgContributorsOverview;
ecoContributorsOverview.forEach((item, i) => {
const { subTypeName, topContributorDistribution } = item;
const colorList = gradientRamp[i];
let count = 0;
topContributorDistribution.forEach(({ subCount, subName }, index) => {
count += subCount;
contributorsData.push({
parentName: subTypeName,
name: subName,
value: subCount,
itemStyle: { color: colorList[index + 1] },
ecoContributorsOverview
.filter((item) => item.subTypeName)
.forEach((item, i) => {
const { subTypeName, topContributorDistribution } = item;
const colorList = gradientRamp[i];
let count = 0;
topContributorDistribution.forEach(({ subCount, subName }, index) => {
count += subCount;
contributorsData.push({
parentName: subTypeName,
name: subName,
value: subCount,
itemStyle: { color: colorList[index + 1] },
});
});
legend.push({
name: subTypeName,
itemStyle: { color: colorList[0] },
});
ecoData.push({
name: subTypeName,
value: count,
itemStyle: { color: colorList[0] },
});
});
legend.push({
name: subTypeName,
itemStyle: { color: colorList[0] },
});
ecoData.push({
name: subTypeName,
value: count,
itemStyle: { color: colorList[0] },
});
});
}
return {
legend,
Expand Down

0 comments on commit 096abdc

Please sign in to comment.