diff --git a/frontend/src/components/details/PieChartComponent.jsx b/frontend/src/components/details/PieChartComponent.jsx index bdf07cdb..f9950c13 100644 --- a/frontend/src/components/details/PieChartComponent.jsx +++ b/frontend/src/components/details/PieChartComponent.jsx @@ -4,7 +4,7 @@ import { getMaterialCompositionData, getMaterialCompositionLabels } from 'interface/projectInterface'; -import theme from 'resources/theme'; +//import theme from 'resources/theme'; /** * Pie Chart Diagram */ @@ -29,15 +29,17 @@ const PieChartComponent = () => { labels: labels, // TODO: color map - colors: [ - '#fae920', - '#cfd6e3', - '#eb8fa1', - '#89b5c4', - theme.color.Alminium, - '#36a6c7', - '#eb8323' - ], + // fill: { + // colors: [ + // '#fae920', + // '#cfd6e3', + // '#eb8fa1', + // '#89b5c4', + // theme.color.Alminium, + // '#36a6c7', + // '#eb8323' + // ] + // }, responsive: [ { breakpoint: 5600, diff --git a/frontend/src/interface/projectInterface.js b/frontend/src/interface/projectInterface.js index ff59ea33..130f2b15 100644 --- a/frontend/src/interface/projectInterface.js +++ b/frontend/src/interface/projectInterface.js @@ -49,13 +49,8 @@ export function setMaterialCompositionData(compositionData) { materialDataInPercent = []; materialCompositionData = Array.from(compositionData); console.log(materialCompositionData); - let sum = 0; for (let i = 0; i < materialCompositionData.length; i++) { - sum += Number(materialCompositionData[i]); - } - console.log(sum); - for (let i = 0; i < materialCompositionData.length; i++) { - materialDataInPercent[i] = (Number(materialCompositionData[i] / sum) * 100).toFixed(2); + materialDataInPercent[i] = Number(materialCompositionData[i]); } console.log(materialDataInPercent); }