Fixed memory issue during exportC function.

Used blob in exportC function instead of string concatenation. Also decimated the data going into chart to reduce memory footprint.