rrdFlotMatrix module


The rrdFlotMatrix Javascript module implements a class used to represents a DS from a list of similar RDD archives as a Flot plot.

All RRDs must have the same step, the same DS names and the same number of RRAs.


Overview

This module provide a single class: rrdFlotMatrix.

Given a RRDFile object, this class creates an interactive Flot plot.

In order to use this module, you also need to include:

Class rrdFlotMatrix

The rrdFlotMatrix constructor has two to five arguments:

Argument

Description

html_id

ID of a HTML element, possibly a DIV.

rrd_files

A list of RRDs. Each element of the list contains a [rrd_id,rrd_file] pair.

  • rrd_id - Logical name for the RRD.
  • rrd_file -An object of type RRDFile or equivalent.

ds_list (optional)

A list of DSes. Each element of the list contains a [ds_id,ds_title] pair.

  • ds_id - Logical name for the DS (as accepted by RRDFile.getDS()).
  • ds_title - Name to display to the user.

If undefined, all the DS's of the RRD will be used.

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},
    tooltip: true,
    tooltipOpts: { content: "<h4>%s</h4> Value: %y.3" }, // %s: series text, %y.3: y-value toPrecision(3)
  };

rrd_graph_options (optional)

Dictionary of graphing options. This must be a dictionary of rrd_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 rrd_name                          // this is what is displayed in the checkboxes
     checked: true                                      // boolean
     label: title or rrd_name                           // this is what is displayed in the legend
     color: rrd_index                                   // see Flot docs for details
     lines: { show:true, fill: true, fillColor:color }  // see Flot docs for details
   }

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


This module is part of the javascriptRRD package hosted at http://javascriptrrd.sourceforge.net.
It is licensed under the MIT license.