fix columnIndex undefined bug

Only generate a graph if we have enough columns to do so.