From 4d4fa4722b83a726471c39f8313dd157ed3a230b Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 18 Apr 2010 23:01:08 +0100 Subject: A create charts from recipe dicts --- jrrd.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'jrrd.js') diff --git a/jrrd.js b/jrrd.js index d49212a..5e723d3 100644 --- a/jrrd.js +++ b/jrrd.js @@ -326,6 +326,26 @@ jrrd.Chart.prototype.draw = function() { }, this); }; + +jrrd.Chart.fromRecipe = function(template, recipe) { + template.find('.title').text(recipe['title']); + var c = new jrrd.Chart(template.find('.chart'), recipe['options']); + var dataDict = {}; + var ds, label, rrd, unit; + for(var i=0; i