Skip to content

Commit

Permalink
feat : update organisms/dailyItemTommorw/index.js (#83)
Browse files Browse the repository at this point in the history
반복문으로 backgroundColor 추가
  • Loading branch information
JungYeonHwi committed Oct 23, 2023
1 parent 10cd91c commit b0f54ef
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions components/organisms/dailyItemTomorrow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const DailyItemTomorrow = (props) => {
return color;
}

const objectLength = data && Object.keys(data).length;
const labels = data && data.map((dataPoint) => dataPoint.itemName);
const itemCountData = data && data.map((dataPoint) => dataPoint.itemCount);

Expand All @@ -56,14 +57,7 @@ const DailyItemTomorrow = (props) => {
{
data: itemCountData,
borderWidth: 2,
backgroundColor: [
getRandomColor(),
getRandomColor(),
getRandomColor(),
getRandomColor(),
getRandomColor(),
getRandomColor(),
],
backgroundColor: Array(objectLength).fill().map(() => getRandomColor()),
},
],
}
Expand Down

0 comments on commit b0f54ef

Please sign in to comment.