Replace fixed numSteps*250 width calculation with ResizeObserver that measures the container and fits the chart within it.