Export dataset values to a .csv file

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
sumaya.baig
Posts: 12
Joined: Tue Nov 07, 2006 6:53 am
Contact:

Export dataset values to a .csv file

Post by sumaya.baig » Mon Nov 13, 2006 1:42 pm

Hi, how do i export the values of the chart data set ( double [][] ) to a .csv file ?

RichardWest
Posts: 844
Joined: Fri Oct 13, 2006 9:29 pm
Location: Sunnyvale, CA

Post by RichardWest » Mon Nov 13, 2006 8:50 pm

Just loop over each column of the array and write each value to a file followed by a comma. Once you are done the row, write a newline to the file. Repeat for each row. Don't worry if your lines (rows) end in an extra comma since these just mean you have a blank cell at the end of the row.[/code]
Richard West
Design Engineer II
Advanced Micro Devices
Sunnyvale, CA

Locked