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.

The Outrageous Inflation of Freddos!

The Inflation of Freddos

Freddos are the well-known, frog-shaped, Cadbury chocolate bar which has existed for decades, originally being produced by MacRobertson’s from 1930. They were then later incorporated into Cadbury product range, and for those of you who are business savvy, they used this to increase their product portfolio size, which therefore subsequently increased their market share, in 1967 when Cadbury bought MacRobertson’s.

The Freddo bar hit the UK’s shelves during the mid-90s, priced at around 5 to 10p. Partially due to inflation the bar’s RRP (Recommended Retail Price) has risen to 25p, representing a roughly 2p a year increase since 2000. Although according to a report from Vouchercloud, their article claims that a Freddo bar should realistically cost 15p if it had risen in line with inflation. This leads me to believe that either, the profit margin for Freddos was too low to justify their retail in the UK or, that Cadbury took advantage of the chocolate bar’s popularity to generate more Revenue. I believe it is most likely the latter. One of the most outrageous parts is, that it’s not as if Cadbury have been offering us more Freddo for our buck either, although we did see a small spike from 17 grams to 20 in 2007, but this was short lived and most likely a greed motivated, extension strategy by Cadbury as in 2007, they dragged it back down to a measly 18 grams.

Now, according to the current inflation rate of Freddos (since 2000) if sales prices continue to rise as consistently as we have seen so far, we should see them setting us back a terrifying 38p per bar by 2030 (Leaving a sweetly bitter taste left after such an expense!) and that is a scary future. Especially if you take note of the fact that they should only be 20p, had the price risen according to inflation.

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!