Writing output as grids for charting