Ensure length has a valid value

Makes it possible to render a stacked graph with a single value which is using
'drawAsInfinite'. Not that it makes a lot of sense to generate such a graph,
but it is certainly better than throwing an obscure exception.