The rrdFlot Javascript module implements a class used to represents a RDD archive as a Flot plot. |
This module provide a single class: rrdFlot.
Given a RRDFile object, this class creates an interactive Flot plot.
In order to use this module, you also need to include:
The rrdFlot constructor has two to four arguments:
Argument |
Description |
---|---|
html_id |
ID of a HTML element, possibly a DIV. |
rrd_file |
An object of type RRDFile, or equivalent. |
graph_options (optional) |
Global graphing options. See Flot documentation for more details. The recognized elements and the default values are: graph_options = { legend: {position:"nw",noColumns:3}, lines: { show:true }, yaxis: { autoscaleMargin: 0.20}, }; |
ds_graph_options (optional) |
Dictionary of graphing options. This must be a dictionary of DS_id. Each element of the dictionary contains graphing options. See Flot documentation for more details. The recognized elements and the default values are: { title: label or ds_name // this is what is displayed in the checkboxes checked: first_ds_in_list? // boolean label: title or ds_name // this is what is displayed in the legend color: ds_index // see Flot docs for details lines: { show:true } // see Flot docs for details yaxis: 1 // can be 1 or 2 stack: 'none' // other options are 'positive' and 'negative' } |
rrdflot_defaults (optional) |
Dictionary of rrd_flot options. The recognized elements and the default values are: { legend: "Top" //Starting location of legend. Options are: //"Top","Bottom","TopRight","BottomRight","None". num_cb_rows: 12 //How many rows of DS checkboxes per column. multi_ds: false //"true" appends the name of the aggregation function to the //name of the DS element. Useful for when an element is displayed //more than once but under different aggregation functions. } |
Once instatiated, the object will automatically draw the plot and handle user interaction.