Reading CSV files

Share RGraph:   Share or Like RGraph on Facebook!

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Armando on 28th February 2013
Hello, i'm trying to read a csv file to draw a Line Graph, however i'm having some problems (like, can't open the file). I've tried the example from www.rgraph.net/docs/basic-csv.html but when I try to run the code the graph does not display :<
Sorry if this question is dumb, but I'm a newbie on this
Thanks
Posted by RGraph support on 28th February 2013
Hi there,

Well you first need to ensure that you are getting the file correctly with your AJAX call. So instead of trying to parse something that may or may not be there - use alert() to verify that you're getting back the file.

Richard, RGraph Support
Posted by Armando on 28th February 2013
So, i've discovered i'm not getting the file :<
is there a way to open it directly from the directory? "C:/.....sample.csv"?
Posted by RGraph support on 28th February 2013
Hi there,

No it needs to be within your "web root". So muh like you can access your webpage with an address like this:

www.foo.com/index.html

Or this (if you're working on your machine):

localhost/index.html

You need to place your CSV file so that you can get to it with something like this:

www.foo.com/mydata.csv

Or this:

localhost/mydata.csv

And if you're not using a webserver (ie you're accessing files through your file system with an address like this: C:\test.html ) - then AJAX won't work. IIRC there's a demo of an AJAX page in the demos folder of the archive - one of the Gauge demos. Though again - you need to be using a webserver.


Richard, RGraph Support
Posted by Dan on 17th March 2013
I meant the X axis for the labels. Please forgive my lack of experience in these postings. I may have doubled up the question. Thanks again everyone.

Add a reply




« Back to message list