// Sparkline pequeño para tablas / cards function Sparkline({ values, color, width = 80, height = 28, strokeWidth = 1.5, fill = true }) { if (!values || values.length < 2) return null; const min = Math.min(...values); const max = Math.max(...values); const range = max - min || 1; const stepX = width / (values.length - 1); const pts = values.map((v, i) => [i * stepX, height - ((v - min) / range) * (height - 4) - 2]); const d = pts.map((p, i) => `${i === 0 ? 'M' : 'L'} ${p[0].toFixed(1)} ${p[1].toFixed(1)}`).join(' '); const dFill = d + ` L ${width} ${height} L 0 ${height} Z`; return ( {fill && ( )} ); } window.Sparkline = Sparkline;