import React from 'react' import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, Cell, ResponsiveContainer, } from 'recharts' import { OHLCVPoint } from '../api/stockApi' interface Props { data: OHLCVPoint[] } function formatVolume(v: number): string { if (v >= 1_000_000) return `${(v / 1_000_000).toFixed(1)}M` if (v >= 1_000) return `${(v / 1_000).toFixed(0)}K` return String(v) } const CustomTooltip = ({ active, payload, label }: any) => { if (!active || !payload?.length) return null const vol: number = payload[0]?.value return (
{label}
Vol: {formatVolume(vol)}