summaryrefslogtreecommitdiff
path: root/doc/lib/rrdFlotMatrix_js.html
blob: ae0aaac06b64f5bf8aea688768fcdae74c92affb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE>rrdFlotMatrix module</TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.0  (Linux)">
	<META NAME="Info 1" CONTENT="">
	<META NAME="Info 2" CONTENT="">
	<META NAME="Info 3" CONTENT="">
	<META NAME="Info 4" CONTENT="">
	<STYLE TYPE="text/css">
	<!--
		@page { margin: 0.79in }
		TD P { margin-bottom: 0.08in }
		H1 { margin-bottom: 0.08in }
		H1.western { font-family: "Liberation Sans", sans-serif; font-size: 22pt }
		P { margin-bottom: 0.08in }
		H2.heading-2-western { font-family: "Liberation Serif", serif; font-size: 16pt }
		TH P { margin-bottom: 0.08in }
		A:link { so-language: zxx }
	-->
	</STYLE>
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<H1 CLASS="western">rrdFlotMatrix module</H1>
<TABLE WIDTH=50% CELLPADDING=2 CELLSPACING=2>
	<TR>
		<TD>
			<HR>
			<P>The <A HREF="../../src/lib/rrdFlotMatrix.js">rrdFlotMatrix Javascript
			module</A> implements a class used to represents a DS from a list of similar 
			<A HREF="http://oss.oetiker.ch/rrdtool/">RDD archives</A> 
	                as a <A HREF="http://www.flotcharts.org/">Flot</A> plot.</P>
		        <P>All RRDs must have the same step, the same DS names and the same number of RRAs.</P>
			<HR>
		</TD>
	</TR>
</TABLE>
<H2 CLASS="heading-2-western">Overview</H2>
<P>This module provide a single class: <A HREF="#rrdFlotMatrix">rrdFlotMatrix</A>.</P>
<P>Given a 
<A HREF="rrdFile_js.html#RRDFile">RRDFile</A> object, this class
creates an interactive
<A HREF="http://www.flotcharts.org/">Flot</A> plot.</P>

<P>In order to use this module, you also need to include:
<UL>
 <LI><A HREF="rrdFlotSupport_js.html">rrdFlotSupport.js</A>
 <LI><A HREF="http://www.flotcharts.org/">jquery.flot.js</A>
 <LI><A HREF="http://jquery.com/">jquery.js</A>
</UL></P>

<H2 CLASS="heading-2-western"><A NAME="rrdFlotMatrix"></A>Class rrdFlotMatrix</H2>
<P>The rrdFlotMatrix constructor has two to six arguments:</P>
<DIV ALIGN=RIGHT>
	<TABLE WIDTH=90% BORDER=1 CELLPADDING=2 CELLSPACING=3>
		<COL WIDTH=51*>
		<COL WIDTH=205*>
		<THEAD>
			<TR VALIGN=TOP>
				<TH WIDTH=20%>
					<P ALIGN=LEFT>Argument</P>
				</TH>
				<TH WIDTH=80%>
					<P ALIGN=LEFT>Description</P>
				</TH>
			</TR>
		</THEAD>
		<TBODY>
			<TR VALIGN=TOP>
				<TD WIDTH=20%>
					<P>html_id</P>
				</TD>
				<TD WIDTH=80%>
					<P>ID of a HTML element, possibly a DIV.</P>
				</TD>
			</TR>
			<TR VALIGN=TOP>
				<TD WIDTH=20%>
					<P>rrd_files</P>
				</TD>
				<TD WIDTH=80%>
				        <P>A list of RRDs. Each element of the list contains a [rrd_id,rrd_file] pair.
				           <ul>
					    <li>rrd_id - Logical name for the RRD.
				            <li>rrd_file -An object of type <A HREF="rrdFile_js.html#RRDFile">RRDFile</A> or equivalent.
					   </ul>
					</P>
				</TD>
			</TR>
			<TR VALIGN=TOP>
				<TD WIDTH=20%>
					<P>ds_list (optional)</P>
				</TD>
				<TD WIDTH=80%>
				        <P>A list of DSes. Each element of the list contains a [ds_id,ds_title] pair.
				           <ul>
					    <li>ds_id - Logical name for the DS (as accepted by
                                                        <A HREF="rrdFile_js.html#RRDFile">RRDFile.getDS()</A>).
				            <li>ds_title - Name to display to the user.
					   </ul>
					</P>
				        <P>If undefined, all the DS's of the RRD will be used.</P>
				</TD>
			</TR>
			<TR VALIGN=TOP>
				<TD WIDTH=20%>
					<P>graph_options (optional)</P>
				</TD>
				<TD WIDTH=80%>
					<P>Global graphing options. See
				           <A HREF="http://www.flotcharts.org/">Flot documentation</A>
				           for more details.</P>
                                        <P>The recognized elements and the default values are:
<PRE>
  graph_options = {
    legend: {position:"nw",noColumns:3},
    lines: { show:true },
    yaxis: { autoscaleMargin: 0.20},
    tooltip: true,
    tooltipOpts: { content: "&lth4&gt%s&lt/h4&gt Value: %y.3" }, // %s: series text, %y.3: y-value toPrecision(3)
  };
</PRE></P>
				</TD>
			</TR>
			<TR VALIGN=TOP>
				<TD WIDTH=20%>
					<P>rrd_graph_options (optional)</P>
				</TD>
				<TD WIDTH=80%>
					<P>Dictionary of graphing options. This must be a dictionary of rrd_id.
				           Each element of the dictionary contains graphing options. See
				           <A HREF="http://www.flotcharts.org/">Flot documentation</A>
				           for more details.</P>
                                        <P>The recognized elements and the default values are:
<PRE>
   {
     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
   }
</PRE></P>
				</TD>
			</TR>
			<TR VALIGN=TOP>
				<TD WIDTH=20%>
					<P>rrdflot_defaults (optional)</P>
				</TD>
				<TD WIDTH=80%>
					<P>Dictionary of rrd_flot options. All are optional.</P>
                                        <P>The recognized elements and the default values are:
<PRE>
 {
    graph_only: false        // If true, limit the display to the graph only
    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.
    use_element_buttons: false  //To be used in conjunction with num_cb_rows: This option
                             //    creates a button above every column, which selects
                             //    every element in the column. 
    multi_rra: false         //"true" appends the name of the RRA consolidation function (CF) 
                             //    (AVERAGE, MIN, MAX or LAST) to the name of the RRA. Useful 
                             //    for RRAs over the same interval with different CFs.  
    use_checked_RRDs: false   //Use the list checked_RRDs below.
    checked_RRDs: []          //List of elements to be checked by default when graph is loaded. 
                             //    Overwrites graph options. 
    use_rra: false           //Whether to use the rra index specified below.
    rra: 0                   //RRA (rra index in rrd) to be selected when graph is loaded. 
    use_windows: false       //Whether to use the window zoom specifications below.
    window_min: 0            //Sets minimum for window zoom. X-axis usually in unix time. 
    window_max: 0            //Sets maximum for window zoom.
    graph_height: "300px"    //Height of main graph. 
    graph_width: "500px"     //Width of main graph.
    scale_height: "110px"    //Height of small scaler graph.
    scale_width: "250px"     //Width of small scaler graph.
 } 
</PRE></P>
				</TD>
			</TR>
      </TABLE>
</DIV>
<P>Once instatiated, the object will automatically draw the plot and handle user interaction.</P>
<TABLE WIDTH=50% CELLPADDING=2 CELLSPACING=2>
        <TR>
                <TD>
                        <HR>
                        <P>This module is part of the <A HREF="index.html">javascriptRRD
                        package</A> hosted at <A HREF="http://javascriptrrd.sourceforge.net/">http://javascriptrrd.sourceforge.net</A>.
                        <BR>It is licensed under the <A HREF="http://www.opensource.org/licenses/mit-license.php">MIT
                        license</A>.
                        </P>
                        <HR>
                </TD>
        </TR>
</TABLE>

</BODY>
</HTML>