Posts

Latest Post

binary tree logic

charts.js import { ResponsiveContainer, PieChart, Pie, Tooltip, BarChart, Bar, XAxis, YAxis, CartesianGrid } from 'recharts' ; export function FundPieChart ({ data }) {   const chartData = ( data || []). map (( f ) => ({ name : f .name, value : Number ( f .percentage) }));   if ( ! chartData . length ) return < p className = "muted" > No allocation yet. </ p > ;   return < ResponsiveContainer width = "100%" height = { 260 } >< PieChart >< Pie data = { chartData } dataKey = "value" nameKey = "name" label />< Tooltip /></ PieChart ></ ResponsiveContainer > ; } export function ContributionBarChart ({ data }) {   const chartData = ( data || []). map (( item ) => ({     month : ` ${ item . _id ?. year || '' } - ${ String ( item . _id ?. month || '' ). padStart ( 2 , '0' ) } ` ,     total : item .total   }));   if ( ! chartData ...