Save data to file

My arduino is aquiring data from a circuit with a scintillation cristal in order to measure the spectrum of radioactive sources. It is displaying instantly the histogram on a lcd screen and the number of the channel of each hit is displayed in the serial output. So in order to be able to save the histogram created, I'd like a way to say to the program that it should save it into a file.