diff --git a/src/components/Charts/BarChartComponent.js b/src/components/Charts/BarChartComponent.js index 1d8e0529d072f1f73b96a6465e99a769ab9068b0..441a5b2c12ce9db0c5b11eecc8b3d508f44f09d5 100644 --- a/src/components/Charts/BarChartComponent.js +++ b/src/components/Charts/BarChartComponent.js @@ -262,6 +262,7 @@ function BarChartComponent(props) { } newSeries[index % size].data.push(d.total); }); + console.log(newOptions) newOptions.xaxis.categories.push(last_year); } @@ -465,6 +466,7 @@ function BarChartComponent(props) { let data = props.data; let tempString = `${chartLocation} - ` tempString = tempString.concat(`${data[0]?.year} a ${data[data?.length - 1]?.year}`) + console.log(data[data.length - 1]) return tempString; } diff --git a/src/components/Charts/PieChartComponent.js b/src/components/Charts/PieChartComponent.js index 338b580c10e83676944c04bf568de1141e63d8a2..9d1e561f02345bd3d470ba9e5fbdb14ca1329ebf 100644 --- a/src/components/Charts/PieChartComponent.js +++ b/src/components/Charts/PieChartComponent.js @@ -46,8 +46,10 @@ function PieChartComponent(props) { let newSeries = []; data.forEach((item) => { - newLabels.push(item[dim + "_name"]); - newSeries.push(item["total"]); + if (!newLabels.includes(item[dim + "_name"])) { + newLabels.push(item[dim + "_name"]); + newSeries.push(item["total"]); + } }); if (pathLocation.pathname === routes.adequacao_disciplina) {