From 2a35d73c7059514adc6b5f8d7febf346dd823675 Mon Sep 17 00:00:00 2001 From: Frank Wuerthwein Date: Thu, 30 Apr 2009 00:22:02 +0000 Subject: Add support for DS grap_options. Also add lines to the list of user specified global graph options --- src/lib/rrdFlot.js | 57 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/src/lib/rrdFlot.js b/src/lib/rrdFlot.js index 4356e6e..c9dbf9c 100644 --- a/src/lib/rrdFlot.js +++ b/src/lib/rrdFlot.js @@ -28,15 +28,30 @@ /* graph_options defaults * { * legend: { position:"nw",noColumns:3}, + * lines: { show:true }, * yaxis: { autoscaleMargin: 0.20} * } + * + * ds_graph_options is a dictionary of DS_name, + * with each element being a graph_option + * The defaults for each element are + * { + * label: ds_name + * color: ds_index + * lines: { show:true } + * yaxis: 1 + * } */ -function rrdFlot(html_id, rrd_file, graph_options) { +function rrdFlot(html_id, rrd_file, graph_options, ds_graph_options) { this.html_id=html_id; this.rrd_file=rrd_file; this.graph_options=graph_options; - + if (ds_graph_options==null) { + this.ds_graph_options=new Object(); // empty object, just not to be null + } else { + this.ds_graph_options=ds_graph_options; + } this.selection_range=new rrdFlotSelection(); this.createHTML(); @@ -184,13 +199,22 @@ rrdFlot.prototype.populateDScb = function() { for (var i=0; i