Home › forums › Using CanvasJS › Load two sets of datapoints from two CSV files
This topic contains 2 replies, has 2 voices, and was last updated by 06chaynes 4 years, 4 months ago.
I need to plot two sets of datapoints to a line graph. Each set of datapoints need to be pulled from a CSV file. Both CSV files have 4 columns and the x axis will be pulled from column 2 (or 1 if you start at 0) and the y axis should be pulled from column 3. Can someone explain how I can accomplish this?
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.
Graph a CSV file
You can also use CSV parsing libraries to simplify the same.
Thank you I was able to get this working and it looks great.
You must be logged in to reply to this topic.