✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚾️ It's finally Baseball season! Root for the home team... & Register for our Sports Analytics Webinar!

Boxplots and lines together

I am trying to create a graph which shows one or more bloxplots, I would also like to plot a line graph in the same graph. Ideally I would like to show a boxplot, and 3 dotted lines which show the good/accept/bad values. I stumble upon problems when I only have 1 single boxplots as it only has 1 X-value (its hard to create a line when there is only one value on the X-axis). I tried creating traces which wasn’t visible at the far left and right but that did not turn out really well. Ideally I would like the line to start and end slightly before and after the boxplot.

Codepen: https://codepen.io/jseffel/pen/GRrMjxB?editors=0010 (only 1 dotted line, but it still shows the problem)

If you view the codepen, uncomment line #6 and #10 to see my problem.