The xaxis in my flot line charts can take an array of data up to but no more than 16 in length. The problem is when my data is less than 16, the x axis is spreading out to show
I've cracked it byadding another data set which is 16 in length but has lines:{show:false} set :) job done!
You can use minTickSize
according to the documentation of flot.
minTickSize : [1, "day"],
One possibility is to provide a number for the ticks option:
ticks: 16
However that is treated only as a guideline; Flot always tries to make the ticks fit, and will reduce the number when it detects that they would overlap or run off the side of the plot. If you really want to force it to use 16 (which I wouldn't recommend, since the labels will probably overlap) you'll need to manually provide an array of ticks:
ticks: [0, 5, 10, ...]