rrdFlot module


The rrdFlot Javascript module implements a class used to represents a RDD archive as a Flot plot.


Overview

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:

Class rrdFlot

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'
   }

Once instatiated, the object will automatically draw the plot and handle user interaction.