Fix NaN handling for stacked graphs.