import React from 'react'; import { BarChart as RechartsBarChart, BarChartProps as RechartsBarChartProps, Bar, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer, } from 'recharts'; export interface BarChartProps extends RechartsBarChartProps { data: ReadonlyArray; showGrid?: boolean; showLegend?: boolean; colors: string[]; } const BarChart: React.FC = (props) => { const { width, height, data, barSize, barCategoryGap, showGrid, showLegend, colors } = props; return ( {showGrid ? : null} {showLegend ? : null} {Object.keys(data[0]).map((key: string, index: number) => { return key !== 'name' ? : null; })} ); }; export default BarChart;