fix(tui): size chart width to data point count

This commit is contained in:
2026-06-21 13:41:05 -04:00
parent ad469c86eb
commit d0805f61c6
+6 -1
View File
@@ -13,8 +13,13 @@ func (m Model) latencyChart(latencies []time.Duration, statuses []bool, width, h
return "" return ""
} }
chartW := len(latencies)
if chartW > width {
chartW = width
}
lineStyle := lipgloss.NewStyle().Foreground(m.theme.Accent) lineStyle := lipgloss.NewStyle().Foreground(m.theme.Accent)
slc := streamlinechart.New(width, height, slc := streamlinechart.New(chartW, height,
streamlinechart.WithStyles(runes.ThinLineStyle, lineStyle), streamlinechart.WithStyles(runes.ThinLineStyle, lineStyle),
) )