I have a Chart.js scatter chart in an HTML document that shows three datasets. The first dataset has 101 datapoints and the chart scales the x- and y- axes correctly.
The other two datasets each contain a single datapoint. In both cases, the x and y values lie within the ranges of the first dataset. However, when I include one or both of these datasets, the y-axis becomes far too large, which causes the plot of the first dataset to be squashed toward the bottom of the chart.
Including one or both of these single-point datasets without the larger dataset has the same effect on the y-axis.
What's going on?
It was simple in the end. I was trying to give it a single datapoint, rather than a list of datapoints containing a single item.
I'm still not entirely sure why that would have affected the y-axis the way it did, but at least this is here now in case anyone else makes the same mistake.