From d792f468dafc224b349073ba35662610c7c848cc Mon Sep 17 00:00:00 2001 From: joseCorte-exe Date: Fri, 12 Aug 2022 11:09:15 -0300 Subject: [PATCH] fixing bar position on charts(coastIndicator, cativoxlivre) --- src/components/graph/cativoXLivreChart/index.tsx | 8 ++++---- src/components/graph/costIndicatorChart/index.tsx | 7 ++++--- src/components/modal/Modal.tsx | 2 -- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/components/graph/cativoXLivreChart/index.tsx b/src/components/graph/cativoXLivreChart/index.tsx index 3222b8a..087aeff 100644 --- a/src/components/graph/cativoXLivreChart/index.tsx +++ b/src/components/graph/cativoXLivreChart/index.tsx @@ -156,9 +156,9 @@ export function CativoXLivreChart({ title, subtitle, chartData, label, dataset1, if (!value.dad_estimado) return parseInt(value.custo_cativo) }), + skipNull: true, borderRadius: 8, backgroundColor: '#C2D5FB', - stack: 'cativo' }, { type: 'bar' as const, @@ -167,9 +167,9 @@ export function CativoXLivreChart({ title, subtitle, chartData, label, dataset1, if (!value.dad_estimado) return parseInt(value.custo_livre) }), + skipNull: true, borderRadius: 8, backgroundColor: '#255488', - stack: 'livre' }, { type: 'bar', @@ -178,9 +178,9 @@ export function CativoXLivreChart({ title, subtitle, chartData, label, dataset1, if (value.dad_estimado) return parseInt(value.custo_cativo) }), + skipNull: true, borderRadius: 8, backgroundColor: pattern.draw('diagonal', '#C2D5FB'), - stack: 'cativo' }, { type: 'bar', @@ -189,9 +189,9 @@ export function CativoXLivreChart({ title, subtitle, chartData, label, dataset1, if (value.dad_estimado) return parseInt(value.custo_livre) }), + skipNull: true, borderRadius: 8, backgroundColor: pattern.draw('diagonal', '#255488'), - stack: 'livre' } ], } diff --git a/src/components/graph/costIndicatorChart/index.tsx b/src/components/graph/costIndicatorChart/index.tsx index ca92efa..5dc7051 100644 --- a/src/components/graph/costIndicatorChart/index.tsx +++ b/src/components/graph/costIndicatorChart/index.tsx @@ -15,6 +15,7 @@ import { import { CostIndicatorChartView } from './CostIndicatorChartView'; import ChartTitle from '../ChartTitle'; +import { Stack } from '@mui/material'; ChartJS.register( CategoryScale, @@ -43,7 +44,7 @@ export default function CostIndicatorChart({ title, data1, data2, label, subtitl responsive: true, scales: { x: { - // stacked: false, + stacked: false, grid: { display: false }, @@ -104,6 +105,7 @@ export default function CostIndicatorChart({ title, data1, data2, label, subtitl label: '2021', data: data1?.map(value => value.custo_unit>0? value.custo_unit : null), borderRadius: 8, + skipNull: true, datalabels: { backgroundColor: 'white', borderRadius: 8, @@ -116,11 +118,11 @@ export default function CostIndicatorChart({ title, data1, data2, label, subtitl else return '#C2d5fb' }, - stack: '0' }, { label: '2022', data: data2?.map(value => value.custo_unit>0? value.custo_unit : null), + skipNull: true, borderRadius: 8, backgroundColor: (value, ctx) => { if (value.dad_estimado) @@ -128,7 +130,6 @@ export default function CostIndicatorChart({ title, data1, data2, label, subtitl else return '#255488' }, - stack: '0' } ], } diff --git a/src/components/modal/Modal.tsx b/src/components/modal/Modal.tsx index 1288582..545f5b1 100644 --- a/src/components/modal/Modal.tsx +++ b/src/components/modal/Modal.tsx @@ -1,6 +1,4 @@ -import { ReactJSXElement } from '@emotion/react/types/jsx-namespace'; import Box from '@mui/material/Box'; -import Button from '@mui/material/Button'; import Modal from '@mui/material/Modal'; import Typography from '@mui/material/Typography'; import * as React from 'react';