Valores Diários
-diff --git a/src/components/graph/LineBarChart.tsx b/src/components/graph/LineBarChart.tsx index 945da91..39f026d 100644 --- a/src/components/graph/LineBarChart.tsx +++ b/src/components/graph/LineBarChart.tsx @@ -114,7 +114,7 @@ export function LineBarChart({ title, subtitle, data1, data2, data3, label, red, }, }; - console.log(label.length) + console.log(data3) const data = data2? { labels: label.length < 28? ['1', '2', '3', '4', '5', '6', '7', '8', '8', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'] : label, @@ -146,7 +146,7 @@ export function LineBarChart({ title, subtitle, data1, data2, data3, label, red, backgroundColor: (value, ctx) => { return hashurado? parseInt(value.dataIndex+1) <= currentTime.getMonth()? '#255488' : pattern.draw('diagonal', '#255488') : '#255488' }, - data: data2.map(value => value.value), + data: data3.map(value => value.value), }, ], } : { @@ -158,8 +158,8 @@ export function LineBarChart({ title, subtitle, data1, data2, data3, label, red, borderColor: red? '#f00' : '#0c9200', borderWidth: 2, - fill: false, - data: data1.map(value => value.value), + fill: true, + data: data1.map(value => value), }, { type: 'bar' as const, diff --git a/src/components/graph/costIndicatorChart/index.tsx b/src/components/graph/costIndicatorChart/index.tsx index c1cb013..387a840 100644 --- a/src/components/graph/costIndicatorChart/index.tsx +++ b/src/components/graph/costIndicatorChart/index.tsx @@ -63,7 +63,7 @@ export default function CostIndicatorChart({ title, data1, data2, label, subtitl dataArr.map(data => { sum += data; }); - const result = `${parseInt(value).toLocaleString('pt-br')}` + const result = `${(parseFloat(value)/10).toLocaleString('pt-br').slice(0, 4)}` return value==null? null : result }, diff --git a/src/components/graph/grossAnualChart/GrossAnualChart.tsx b/src/components/graph/grossAnualChart/GrossAnualChart.tsx index ee7f3b1..c8dadb4 100644 --- a/src/components/graph/grossAnualChart/GrossAnualChart.tsx +++ b/src/components/graph/grossAnualChart/GrossAnualChart.tsx @@ -29,15 +29,11 @@ interface SingleBarInterface{ bruta?: boolean | undefined } -export function GrossAnulChart({ title, subtitle, dataProps, label, dataset, barLabel, miniature, bruta }: SingleBarInterface) { +export function GrossAnualChart({ title, subtitle, dataProps, label, dataset, barLabel, miniature, bruta }: SingleBarInterface) { function spacement(string) { - let spaces = '⠀' - let i=Math.abs(string) + const spaces = string.length===1?'' : string.length===2? '⠀⠀⠀⠀' : string.length===3? '⠀⠀⠀' : string.length===4? '⠀⠀' : string.length===5? '⠀' : '' - while (i <= 1) { - i-- - spaces = spaces + `⠀` - } + console.log(string.length) return spaces } @@ -75,7 +71,7 @@ export function GrossAnulChart({ title, subtitle, dataProps, label, dataset, bar sum += data; }); const percentage = (dataProps[ctx.dataIndex].econ_percentual*100).toFixed(0)+"%"; - const result = `${spacement(parseInt(value).toLocaleString('pt-br'))} ${percentage}\n${parseInt(value).toLocaleString('pt-br')}` + const result = `${spacement(parseInt(value).toLocaleString('pt-br'))}${percentage}\n${parseInt(value).toLocaleString('pt-br')}${spacement(parseInt(value).toLocaleString('pt-br'))}` return value==null? null : result }, diff --git a/src/components/graph/grossMensalChart/GrossMensalChart.tsx b/src/components/graph/grossMensalChart/GrossMensalChart.tsx index 3a20a45..6a184f3 100644 --- a/src/components/graph/grossMensalChart/GrossMensalChart.tsx +++ b/src/components/graph/grossMensalChart/GrossMensalChart.tsx @@ -43,13 +43,9 @@ interface ChartInterface { export default function GrossMensalChart({ title, data1, data2, label, subtitle, miniature }: ChartInterface) { function spacement(string) { - let spaces = '⠀' - let i=Math.abs(string) + const spaces = string.length===1?'' : string.length===2? '⠀⠀⠀⠀' : string.length===3? '⠀⠀⠀' : string.length===4? '⠀⠀' : string.length===5? '⠀' : '' - while (i <= 1) { - i-- - spaces = spaces + `⠀` - } + console.log(string.length) return spaces } diff --git a/src/components/sidebar/Sidebar.tsx b/src/components/sidebar/Sidebar.tsx index b87ed41..325241f 100644 --- a/src/components/sidebar/Sidebar.tsx +++ b/src/components/sidebar/Sidebar.tsx @@ -119,7 +119,7 @@ export default function Sidebar() {
| Mês | @@ -262,20 +261,6 @@ export default function pld({tableData, userName, clientMonth}: pldInterface) { }
|---|
Valores Diários
-Valores Horários
-| Mês | +Nordeste | +Norte | +Sudeste | +Sul | +
|---|---|---|---|---|
| {data.year_month_formatted} | +{parseFloat(data.nordeste).toLocaleString('pt-br',{currency: 'BRL', minimumFractionDigits: 2, maximumFractionDigits: 2})} | +{parseFloat(data.norte).toLocaleString('pt-br',{currency: 'BRL', minimumFractionDigits: 2, maximumFractionDigits: 2})} | +{parseFloat(data.sudeste).toLocaleString('pt-br',{currency: 'BRL', minimumFractionDigits: 2, maximumFractionDigits: 2})} | +{parseFloat(data.sul).toLocaleString('pt-br',{currency: 'BRL', minimumFractionDigits: 2, maximumFractionDigits: 2})} | +
| Máximo | +{parseFloat(data.nordeste_max).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2, maximumFractionDigits: 2})} | +{parseFloat(data.norte_max).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2, maximumFractionDigits: 2})} | +{parseFloat(data.sudeste_max).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2, maximumFractionDigits: 2})} | +{parseFloat(data.sul_max).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2, maximumFractionDigits: 2})} | +
| Mínimo | +{parseFloat(data.nordeste_min).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2, maximumFractionDigits: 2})} | +{parseFloat(data.norte_min).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2, maximumFractionDigits: 2})} | +{parseFloat(data.sudeste_min).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2, maximumFractionDigits: 2})} | +{parseFloat(data.sul_min).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2, maximumFractionDigits: 2})} | +
| Desv. Padrão | +{parseFloat(data.nordeste_desv_pad).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})} | +{parseFloat(data.norte_desv_pad).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})} | +{parseFloat(data.sudeste_desv_pad).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})} | +{parseFloat(data.sul_desv_pad).toLocaleString('pt-br',{style: 'currency', currency: 'BRL', minimumFractionDigits: 2})} | +