Now we have a Tutorial on Creating Charts from CSV Data in our documentation.
You can split each line using some known separator and push resulting values into appropriate arrays. Here is an example which Anjali has given in another thread. Hope this helps.
You can also use CSV parsing libraries to simplify the same.