Dygraphs autoupdate from a CSV file

I couldn’t get autoupdating to work with dygraph with the examples they gave due to it being for randomly generated data here is how you get it to update with a CSV.

This is the code I ended up with it seems to work without error.

Make sure that you don’t have any labels at the top of your CSV file and instead use: “labels: [‘Time’, ‘Status’],” putting in your labels as needed.

Making your file look like so

Other examples will use:
“graph1.updateOptions(¬†{‘file’: plotData¬†});”

But I found this didn’t work throwing up an error saying “plotdata is undefined”¬† the same goes for

“graph1.updateOptions( { ‘file’: csv_data } );”

I found that using:

“graph1.updateOptions( { ‘file’: “/solarvoltage/voltage.txt” } );”

and actually defining the file is what got it to work in the end.

I have moved the site to wordpress!

Using wordpress is much easier than trying to make a website from scratch and make it look good in the progess. It also supports everything that you would normally get from editing the html in a text editor but on the web with a much nicer layout.

I have also wanted to move the site towards photography the blog on wordpress is a good way to share the best pictures of the lot.

Hopefully more intresting posts and other things will be on their way soon!