- added beneficiary stats page;
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { Tooltip, ResponsiveContainer, Cell, Pie, PieChart } from 'recharts';
|
||||
import { Tooltip, ResponsiveContainer, Cell, Pie, PieChart, Legend } from 'recharts';
|
||||
import { isEmpty } from 'ramda';
|
||||
import getBandoLabel from '../../helpers/getBandoLabel';
|
||||
|
||||
// components
|
||||
// tools
|
||||
import getBandoLabel from '../../helpers/getBandoLabel';
|
||||
|
||||
|
||||
const ChartDomandePerStato = ({ title, data = [] }) => {
|
||||
@@ -36,15 +36,13 @@ const ChartDomandePerStato = ({ title, data = [] }) => {
|
||||
}
|
||||
return acc;
|
||||
}, {
|
||||
inProgress: {value: 0, label: 'In corso'},
|
||||
approved: {value: 0, label: 'Approvato'},
|
||||
rejected: {value: 0, label: 'Respinto'}
|
||||
inProgress: {value: 0, label: __('In corso', 'gepafin')},
|
||||
approved: {value: 0, label: __('Approvato', 'gepafin')},
|
||||
rejected: {value: 0, label: __('Respinto', 'gepafin')}
|
||||
});
|
||||
setChartData(grouped)
|
||||
}, [data]);
|
||||
|
||||
console.log('chartData', chartData)
|
||||
|
||||
return (<div className="chartCard">
|
||||
{title ? <span className="chartCard__title">{title}</span> : null}
|
||||
{chartData && !isEmpty(chartData)
|
||||
@@ -70,6 +68,7 @@ const ChartDomandePerStato = ({ title, data = [] }) => {
|
||||
))}
|
||||
</Pie>
|
||||
<Tooltip content={<CustomTooltip />} />
|
||||
<Legend verticalAlign="top" height={36}/>
|
||||
</PieChart>
|
||||
</ResponsiveContainer>
|
||||
</div> : null}
|
||||
|
||||
Reference in New Issue
Block a user