What you are describing is what happens when you have empty rows in your data series. Numbers does not have the option of connecting points across a gap.
If you use a line chart (not the scatter chart), you can create a new series in your table that interpolates the missing points. Plot it as a second series with the same line color but no data points. Interpolation across a one row gap is easy to do. Interpolation across several rows is easy to do. Interpolation across a gap that might be one row or might be more is hard to do with a formula that works regardless of the size of the gap (I cannot think of a formula to do it off-hand).
If you use a scatter chart, you can use Reorganize to hide all rows where the Y data is blank. The remaining rows of data will plot and the dots will all be connected. If you don't want to hide rows in your data table, you can create a separate table that pulls in the data. Use that table for your chart, showing only rows that have Y data.
Note that you can use Reorganize for a line chart too but it will not plot the hidden X categories.