├── DESCRIPTION.txt ├── INSTALL.txt ├── LICENSE.txt ├── README.txt ├── doc └── lib │ ├── binaryXHR_js.html │ ├── index.html │ ├── rrdFile_js.html │ ├── rrdFlotMatrix_js.html │ ├── rrdFlotSupport_js.html │ ├── rrdFlot_js.html │ └── rrdMultiFile_js.html ├── examples ├── example1.rrd ├── example2.rrd ├── example3.rrd ├── example4.rrd ├── example4_s1.rrd ├── example4_s2.rrd ├── example4_s3.rrd ├── index.html ├── rrdContent.js ├── rrdHeaderInfo.js ├── rrdJFlot.html ├── rrdJFlotTwo.html └── rrdMatrixFlot.html └── lib ├── binaryFile.js ├── rrdFile.js ├── rrdFilter.js ├── rrdFlot.js ├── rrdFlotMatrix.js ├── rrdFlotSupport.js └── rrdMultiFile.js /DESCRIPTION.txt: -------------------------------------------------------------------------------- 1 | javascriptRRD 2 | ============= 3 | 4 | javascriptRRD is Javascript implementation of a client side RRD tool. 5 | 6 | -------------------------------------------------------------------------------- /INSTALL.txt: -------------------------------------------------------------------------------- 1 | javascriptRRD installation 2 | ========================== 3 | 4 | Being Javascript an interpreted language, no compilation is needed. 5 | Just copy the files in the files located in the 6 | src/lib 7 | directory into a Web accessible location and use them. 8 | 9 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | javascriptRRD is licensed under the MIT License 2 | [http://www.opensource.org/licenses/mit-license.php] 3 | 4 | Copyright (c) 2010 Frank Wuerthwein, fkw@ucsd.edu 5 | Igor Sfiligoi, isfiligoi@ucsd.edu 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | 25 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | javascriptRRD 2 | ============= 3 | 4 | javascriptRRD package contains a set of Javascript libraries 5 | that can be used for reading RRD archives from any Web browser. 6 | Mozilla, Internet Explorer and Safari havae been tested. 7 | 8 | Being Javascript an interpreted language, no compilation is needed. 9 | Just copy the files in the files located in the 10 | src/lib 11 | directory into a Web accessible location and use them. 12 | 13 | The 14 | src/examples/ 15 | directory contain example Web pages that you can use as a template 16 | for writing your own Web Browser applications for accessing the 17 | RRD archives on your Web server. 18 | 19 | While the code itself tries to be self documenting, the 20 | doc/lib/ 21 | directory contains more detailed information about the libraries. 22 | 23 | -------------------------------------------------------------------------------- /doc/lib/binaryXHR_js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |
31 | 32 | The binaryXHR Javascript 33 | module implements a set of functions and classes that can be 34 | used to retrieve binary files using the XMLHttpRequest 35 | API. 36 |37 | |
38 |
This module provides two functions, 42 | FetchBinaryURL and 43 | FetchBinaryURLAsync, 44 | that are wrappers around the 45 | XMLHttpRequest API 46 | and return an object of type 47 | BinaryFile. 48 | The first one implements a 49 | straight load, while the second one initiates an asynchronous 50 | operation handled by a callback function.
51 |The BinaryFile class implements the methods needed to access the 52 | elements of the binary files, such as strings, integers and real 53 | numbers. 54 |
55 |Both the functions and the class internally handle the differences 56 | between different Web Browsers, so the user of this module does not 57 | need to worry about them.
58 | 59 |Load a binary file.
62 |Arguments:
63 |url:string - URL from where to load the binary file.
65 |Output:
67 |An object of type BinaryFile.
69 |Initiate an asynchronous binary load.
74 |Arguments:
75 |url:string - URL from where to load the binary file.
77 |callback:function(obj[,arg]) - Pointer to the function that will
78 | be called when the binary file has been loaded.
79 | The function will be
80 | given one or two arguments; the first one is an object of type BinaryFile.
81 | The second one is the argument described below, if available.
callback_arg:any (optional) - If present, it will be given as argument to the callback function.
83 |Output:
85 |A reference to the XMLHttpRequest object.
87 | It may be used to verify the status of the load or to implement timeouts.
88 | The callback function will receive the loaded binary file.
This class implements the methods needed to access the content of 94 | the binary file.
95 |
102 | Method 103 | |
104 |
105 | Description 106 | |
107 |
---|---|
112 | getLength() 113 | |
114 |
115 | Return the number of bytes held by the object. 116 | |
117 |
120 | getByteAt(idx) 121 | |
122 |
123 | Return an 8 bit unsigned integer from offset idx. 124 | |
125 |
128 | getShortAt(idx) 129 | |
130 |
131 | Return a 16 bit little endian unsigned integer from offset 132 | idx. 133 | 134 | |
135 |
138 | getLongAt(idx) 139 | |
140 |
141 | Return a 32 bit little endian unsigned integer from offset 142 | idx. 143 | |
144 |
147 | getSByteAt(idx) 148 | |
149 |
150 | Return an 8 bit signed integer from offset idx. 151 | |
152 |
155 | getSShortAt(idx) 156 | |
157 |
158 | Return a 16 bit little endian signed integer from offset 159 | idx. 160 | 161 | |
162 |
165 | getSLongAt(idx) 166 | |
167 |
168 | Return a 32 bit little endian signed integer from offset 169 | idx. 170 | |
171 |
174 | getDoubleAt(idx) 175 | |
176 |
177 | Return a double float (64 bit little endian) from offset idx. 178 |Return undefined if the value is not a float or is infinity. 179 | |
180 |
183 | getFastDoubleAt(idx) 184 | |
185 |
186 | Return a low resolution (20 bit mantissa) double flat 187 | obtained from the high 32 bits of the original little endian 188 | double float from offset idx. 189 |Return undefined if the value is not a float or is infinity. 190 | |
191 |
194 | getCharAt(idx) 195 | |
196 |
197 | Get a character from offset idx. 198 | |
199 |
202 | getCStringAt(idx,maxlen) 203 | |
204 |
205 | Get a zero terminated string of limited size from offset idx. 206 | 207 | 208 | |
209 |
212 | getStringAt(idx,len) 213 | |
214 |
215 | Get a fixed length string from offset idx. 216 | |
217 |
This is a helper exception class that can be thrown while loading the binary file.
225 |
229 | 230 | This module is part of the javascriptRRD
231 | package hosted at http://javascript.sourceforge.net.
232 | 236 | |
237 |
The javascriptRRD package contains base three javascript modules:
22 |The rrdFile module, used to 24 | extract information from RRD 25 | archives loaded as binary file objects.
26 |The rrdMultiFile module, 27 | used to combine many rrdFile objects.
28 |The binaryXHR module, used to 29 | retrieve binary files using the XMLHttpRequest 30 | API.
31 |Together they can be used to implement AJAX style applications.
33 |The package also provides two classes, based on 34 | JFlot, 35 | that automate most of the graphing needs:
36 |The rrdFlot module can be used to plot a single RRD file.
38 | See also the rrdJFlot.html example.
The rrdFlotMatrix module can be used to plot a list of RRD files.
40 | See also the rrdMatrixFlot.html example.
More examples can be found on the 43 | examples web page.
44 |
49 | 50 | The javascriptRRD package
51 | is hosted at http://javascript.sourceforge.net.
52 | 56 | |
57 |
31 | 32 | The rrdFile Javascript 33 | module implements a set of classes that can be used to extract 34 | information from RRD 35 | archives loaded as binary file objects. 36 |37 | |
38 |
The main class in this module is RRDFile. 42 | It interprets the given the binary file object and provides methods 43 | to decode the RRD 44 | information.
45 |This is the main class of the package. It is also the only class 47 | the user ever needs to explicitly instantiate.
48 |The RRDFile constructor has a single argument:
49 |A binary file object.
51 |Any object implementing an interface providing the following 52 | methods can be used:
53 |getByteAt(idx) - Return a 8 bit unsigned integer at offset 55 | idx.
56 |getLongAt(idx) - Return a 32 bit unsigned integer at offset 57 | idx.
58 |getDoubleAt(idx) - Return a double float at offset idx.
59 |getFastDoubleAt(idx) - Similar to getDoubleAt but with less 60 | precision.
61 |getCStringAt(idx,maxsize) - Return a string of at most 62 | maxsize characters that was 0-terminated in the source.
63 |The binaryXHR module, provided 65 | with this package, provides the class BinaryFile 66 | that implements this interface.
67 |If the binary file is not a proper RRD 69 | file, an InvalidRRD exception will be 70 | thrown.
71 |This class also implements the following methods:
72 |
79 | Method 80 | |
81 |
82 | Description 83 | |
84 |
---|---|
89 | getMinStep() 90 | |
91 |
92 | Return the base interval 93 | in seconds that was used to feed the RRD file. 94 | |
95 |
98 | getLastUpdate() 99 | |
100 |
101 | Return the timestamp of the last 102 | update. 103 | |
104 |
107 | getNrDSs() 108 | |
109 |
110 | Return the number of Data 111 | Sources present in the RRD file. 112 | 113 | |
114 |
117 | getDSNames() 118 | |
119 |
120 | Return the names of the Data 121 | Sources present in the RRD file. 122 | 123 | |
124 |
127 | getDS(id) 128 | |
129 |
130 | If id is a number, return an object of type RRDDS holding 131 | the information about the id-th Data 132 | Source. 133 |If id is a string, return an object of type RRDDS holding 134 | the information about the Data 135 | Source with the requested name. 136 | |
137 |
140 | getNrRRAs() 141 | |
142 |
143 | Return the number of Round 144 | Robin Archives present in the RRD file. 145 | |
146 |
149 | getRRAInfo(n) 150 | |
151 |
152 | Return an object of type RRDRRAInfo 153 | holding the information about the n-th Round 154 | Robin Archive. 155 | |
156 |
159 | getRRA(n) 160 | |
161 |
162 | Return an object of type RRDRRA that 163 | can be used to access the values stored in the n-th Round 164 | Robin Archive. 165 | |
166 |
This class implements the methods needed to access the information 172 | about a RRD 173 | Data Source.
174 |
181 | Method 182 | |
183 |
184 | Description 185 | |
186 |
---|---|
191 | getIdx() 192 | |
193 |
194 | Return which DS it is in the RRD file. 195 | |
196 |
199 | getName() 200 | |
201 |
202 | Return the name of the data source. 203 | |
204 |
207 | getType() 208 | |
209 |
210 | Return the type 211 | of the data source. 212 | |
213 |
216 | getMin() 217 | |
218 |
219 | Return the minimum and maximum value the data source can 220 | contain. 221 | 222 |If either is not defined, undefined is returned. 223 | |
224 |
227 | getMax() 228 | |
229 |
This class implements the methods needed to access the information 236 | about a Round 237 | Robin Archive.
238 |
245 | Method 246 | |
247 |
248 | Description 249 | |
250 |
---|---|
255 | getIdx() 256 | |
257 |
258 | Return which RRA it is in the RRD file. 259 | |
260 |
263 | getNrRows() 264 | |
265 |
266 | Return the number of rows in the RRA. 267 | |
268 |
271 | getStep() 272 | |
273 |
274 | Return the number of seconds between rows. 275 | |
276 |
279 | getCFName() 280 | |
281 |
282 | Return the Consolidation 283 | Function used by the RRA. 284 | |
285 |
288 | getPdpPerRow() 289 | |
290 |
291 | Return number of slots used for consolidation. 292 | |
293 |
This class implements the methods needed to access the content of 299 | a Round 300 | Robin Archive.
301 |
308 | Method 309 | |
310 |
311 | Description 312 | |
313 |
---|---|
318 | getIdx() 319 | |
320 |
321 | Return which RRA it is in the RRD file. 322 | |
323 |
326 | getCFName() 327 | |
328 |
329 | Return the Consolidation 330 | Function used by the RRA. 331 |The current implementation only supports
332 | AVERAGE,MAXIMUM,MINIMUM and LAST. |
336 |
339 | getNrRows() 340 | |
341 |
342 | Return the number of rows in the RRA. 343 | |
344 |
347 | getNrDSs() 348 | |
349 |
350 | Return the number of Data 351 | Sources present in the RRA. 352 | |
353 |
356 | getStep() 357 | |
358 |
359 | Return the number of seconds between rows. 360 | |
361 |
364 | getEl(r,d) 365 | |
366 |
367 | Return the value for the d-th DS in the r-th row. 368 | |
369 |
372 | getElFast(row,ds) 373 | |
374 |
375 | Return the low-precision value for the d-th DS in the r-th 376 | row. 377 | |
378 |
This is a helper exception class that can be thrown while 385 | interpreting the binary file object.
386 |
387 |
391 | 392 | This module is part of the javascriptRRD
393 | package hosted at http://javascript.sourceforge.net.
394 | 398 | |
399 |
29 | 30 | The rrdFlotMatrix Javascript 31 | module implements a class used to represents a DS from a list of similar 32 | RDD archives 33 | as a Flot plot. 34 |All RRDs must have the same step, the same DS names and the same number of RRAs. 35 |36 | |
37 |
This module provide a single class: rrdFlotMatrix.
41 |Given a 42 | RRDFile object, this class 43 | creates an interactive 44 | Flot plot.
45 | 46 |In order to use this module, you also need to include: 47 |
The rrdFlotMatrix constructor has two to five arguments:
55 |
62 | Argument 63 | |
64 |
65 | Description 66 | |
67 |
---|---|
72 | html_id 73 | |
74 |
75 | ID of a HTML element, possibly a DIV. 76 | |
77 |
80 | rrd_files 81 | |
82 |
83 | A list of RRDs. Each element of the list contains a [rrd_id,rrd_file] pair. 84 |
|
90 |
93 | ds_list (optional) 94 | |
95 |
96 | A list of DSes. Each element of the list contains a [ds_id,ds_title] pair. 97 |
If undefined, all the DS's of the RRD will be used. 104 | |
105 |
108 | graph_options (optional) 109 | |
110 |
111 | Global graphing options. See 112 | Flot documentation 113 | for more details. 114 |The recognized elements and the default values are: 115 | 116 | graph_options = { 117 | legend: {position:"nw",noColumns:3}, 118 | lines: { show:true }, 119 | yaxis: { autoscaleMargin: 0.20}, 120 | }; 121 |122 | |
123 |
126 | rrd_graph_options (optional) 127 | |
128 |
129 | Dictionary of graphing options. This must be a dictionary of rrd_id. 130 | Each element of the dictionary contains graphing options. See 131 | Flot documentation 132 | for more details. 133 |The recognized elements and the default values are: 134 | 135 | { 136 | title: label or rrd_name // this is what is displayed in the checkboxes 137 | checked: true // boolean 138 | label: title or rrd_name // this is what is displayed in the legend 139 | color: rrd_index // see Flot docs for details 140 | lines: { show:true, fill: true, fillColor:color } // see Flot docs for details 141 | } 142 |143 | |
144 |
Once instatiated, the object will automatically draw the plot and handle user interaction.
148 | 149 | 150 | -------------------------------------------------------------------------------- /doc/lib/rrdFlotSupport_js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
29 | 30 | The rrdFlotSupport Javascript module 31 | implements a set of commonly used functions an classes that may be used while plotting 32 | RRD files with 33 | Flot. 34 |35 | |
36 |
This module provides two types of support: 40 |
This function extracts a specific DS from a specific RRA and returns an object that 52 | contains the data in format flot expects.
53 |54 | Input parameters: 55 |
56 |
63 | Parameter 64 | |
65 |
66 | Description 67 | |
68 |
---|---|
73 | rrd_file 74 | |
75 |
76 | An object of type RRDFile or equivalent. 77 | |
78 |
81 | ds_id 82 | |
83 |
84 | Identifier of the desired DS (as accepted by 85 | RRDFile.getDS()). 86 | |
87 |
90 | rra_idx 91 | |
92 |
93 | Index of the desired RRA. 94 | |
95 |
98 | want_rounding 99 | |
100 |
101 | If not false, all timestamps will be truncated to the RRA step. 102 | |
103 |
108 | The output is an object containing: 109 |
110 |
117 | Attribute 118 | |
119 |
120 | Description 121 | |
122 |
---|---|
127 | data 128 | |
129 |
130 | A list of datapoints suitable to be fed to Flot. Each element is a (Timestamp in ms, value) pair. 131 | An example of use with Flot: 133 | var fd=rrdDS2FlotSeries(...); 134 | var plot = $.plot("#myplot", [{data:fd.data}], options); 135 |136 | 137 | |
138 |
141 | label 142 | |
143 |
144 | The DS name. 145 | |
146 |
149 | min 150 | |
151 |
152 | Min and max timestamp in ms. 153 | |
154 |
157 | max 158 | |
159 |
This function extracts a list of DSs from a specific RRA and returns an object that 165 | contains the data in format flot expects.
166 |167 | Input parameters: 168 |
169 |
176 | Parameter 177 | |
178 |
179 | Description 180 | |
181 |
---|---|
186 | rrd_file 187 | |
188 |
189 | An object of type RRDFile or equivalent. 190 | |
191 |
194 | rra_idx 195 | |
196 |
197 | Index of the desired RRA. 198 | |
199 |
202 | ds_list 203 | |
204 |
205 | List of DS identifiers (as accepted by 206 | RRDFile.getDS()). 207 | |
208 |
211 | want_ds_labels 212 | |
213 |
214 | Should the DS names be included as labels in the output? 215 | (If false, only the order distinguishes the requested DSs) 216 | |
217 |
220 | want_rounding 221 | |
222 |
223 | If not false, all timestamps will be truncated to the RRA step. 224 | |
225 |
230 | The output is an object containing: 231 |
232 |
239 | Attribute 240 | |
241 |
242 | Description 243 | |
244 |
---|---|
249 | data 250 | |
251 |
252 | A list of objects suitable to be fed to Flot. Each element is an object composed of two attributes:
An example of use with Flot: 257 | var fd=rrdDS2FlotObj(...); 258 | var plot = $.plot("#myplot", fd.data, options); 259 |260 | 261 | |
262 |
265 | min 266 | |
267 |
268 | Min and max timestamp in ms. 269 | |
270 |
273 | max 274 | |
275 |
This function extracts a list of DSs from a specific RRA, stacks them as requested and 281 | returns an object that contains the data in format flot expects.
282 |283 | Input parameters: 284 |
285 |
292 | Parameter 293 | |
294 |
295 | Description 296 | |
297 |
---|---|
302 | rrd_file 303 | |
304 |
305 | An object of type RRDFile or equivalent. 306 | |
307 |
310 | rra_idx 311 | |
312 |
313 | Index of the desired RRA. 314 | |
315 |
318 | ds_positive_stack_list 319 | |
320 |
321 | List of DS identifiers (as accepted by 322 | RRDFile.getDS()) 323 | to be stacked. All values must be positive if 324 | ds_negative_stack_list is not empty. 325 | |
326 |
329 | ds_negative_stack_list 330 | |
331 |
332 | List of DS identifiers (as accepted by 333 | RRDFile.getDS()) 334 | to be stacked. All values must be negative if 335 | ds_positive_stack_list is not empty. 336 | |
337 |
340 | ds_single_list 341 | |
342 |
343 | List of DS identifiers (as accepted by 344 | RRDFile.getDS()). 345 | No stacking for these ones. 346 | |
347 |
350 | want_ds_labels 351 | |
352 |
353 | Should the DS names be included as labels in the output? 354 | (If false, only the order distinguishes the requested DSs) 355 | |
356 |
359 | want_rounding 360 | |
361 |
362 | If not false, all timestamps will be truncated to the RRA step. 363 | |
364 |
367 | one_undefined_enough 368 | |
369 |
370 | If true, a whole stack is invalidated if a 371 | single element of the stack is invalid. 372 | |
373 |
378 | The output is an object containing: 379 |
380 |
387 | Attribute 388 | |
389 |
390 | Description 391 | |
392 |
---|---|
397 | data 398 | |
399 |
400 | A list of objects suitable to be fed to Flot. Each element is an object composed of two attributes:
An example of use with Flot: 405 | var fd=rrdDS2FlotObj(...); 406 | var plot = $.plot("#myplot", fd.data, options); 407 |408 | 409 | |
410 |
413 | min 414 | |
415 |
416 | Min and max timestamp in ms. 417 | |
418 |
421 | max 422 | |
423 |
This function extracts a DS from a list of RRDs, using a specific RRA index, then stacks them and 429 | returns an object that contains the data in format flot expects.
430 |431 | Input parameters: 432 |
433 |
440 | Parameter 441 | |
442 |
443 | Description 444 | |
445 |
---|---|
450 | rrd_files 451 | |
452 |
453 | A list of RRDs. Each element of the list contains a [rrd_id,rrd_file] pair. 454 |
|
460 |
463 | rra_idx 464 | |
465 |
466 | Index of the desired RRA. 467 | |
468 |
471 | ds_id 472 | |
473 |
474 | DS indentifier (as accepted by 475 | RRDFile.getDS()) 476 | |
477 |
480 | want_rrd_labels 481 | |
482 |
483 | Should the RRD names be included as labels in the output? 484 | (If false, only the order distinguishes the requested RRDs) 485 | |
486 |
489 | want_rounding 490 | |
491 |
492 | If not false, all timestamps will be truncated to the RRA step. 493 | |
494 |
497 | one_undefined_enough 498 | |
499 |
500 | If true, a whole stack is invalidated if a 501 | single element of the stack is invalid. 502 | |
503 |
508 | The output is an object containing: 509 |
510 |
517 | Attribute 518 | |
519 |
520 | Description 521 | |
522 |
---|---|
527 | data 528 | |
529 |
530 | A list of objects suitable to be fed to Flot. Each element is an object composed of two attributes:
An example of use with Flot: 535 | var fd=rrdDS2FlotObj(...); 536 | var plot = $.plot("#myplot", fd.data, options); 537 |538 | 539 | |
540 |
543 | min 544 | |
545 |
546 | Min and max timestamp in ms. 547 | |
548 |
551 | max 552 | |
553 |
Helper class to handle Flot selections. 559 |
560 |
567 | Method 568 | |
569 |
570 | Description 571 | |
572 |
---|---|
577 | reset() 578 | |
579 |
580 | Clear the selection. (isSet() will return False) 581 | |
582 |
585 | isSet() 586 | |
587 |
588 | Was a selection set? 589 | |
590 |
593 | setFromFlotRanges(ranges) 594 | |
595 |
596 | Set the selection to ranges.xaxis. See plotselected 597 | Flot 598 | event for more info on ranges. (isSet() will return True, and getFlotRanges() can now be called.) 599 | |
600 |
603 | getFlotRanges() 604 | |
605 |
606 | Return a ranges object. See plotselected 607 | Flot 608 | event for more info on ranges. 609 | |
610 |
613 | trim_flot_data(flot_data) 614 | |
615 |
616 | Create a new Flot data object by selecting only the data points within the current selection. 617 |An example Flot data object is 618 | 619 | rrdDS2FlotObj(...).data 620 |621 | |
622 |
625 | trim_data(data_list) 626 | |
627 |
628 | Create a new data list by selecting only the data points within the current selection. 629 |An example data list is 630 | 631 | rrdDS2FlotSeries(...).data 632 |633 | |
634 |
Pseudo-example of use: 639 |
640 | myplotplot.bind("plotselected", function (event, ranges) { 641 | // do the zooming 642 | selection_range.setFromFlotRanges(ranges); 643 | graph_options.xaxis.min=ranges.xaxis.from; 644 | graph_options.xaxis.max=ranges.xaxis.to; 645 | mygraph = $.plot("#mygraph", selection_range.trim_flot_data(flot_data), graph_options); 646 | }); 647 |648 | 649 | 650 | 651 | -------------------------------------------------------------------------------- /doc/lib/rrdFlot_js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
29 | 30 | The rrdFlot Javascript 31 | module implements a class used to represents a 32 | RDD archive 33 | as a Flot plot. 34 |35 | |
36 |
This module provide a single class: rrdFlot.
40 |Given a 41 | RRDFile object, this class 42 | creates an interactive 43 | Flot plot.
44 | 45 |In order to use this module, you also need to include: 46 |
The rrdFlot constructor has two to four arguments:
54 |
61 | Argument 62 | |
63 |
64 | Description 65 | |
66 |
---|---|
71 | html_id 72 | |
73 |
74 | ID of a HTML element, possibly a DIV. 75 | |
76 |
79 | rrd_file 80 | |
81 |
82 | An object of type RRDFile, or equivalent. 83 | |
84 |
87 | graph_options (optional) 88 | |
89 |
90 | Global graphing options. See 91 | Flot documentation 92 | for more details. 93 |The recognized elements and the default values are: 94 | 95 | graph_options = { 96 | legend: {position:"nw",noColumns:3}, 97 | lines: { show:true }, 98 | yaxis: { autoscaleMargin: 0.20}, 99 | }; 100 |101 | |
102 |
105 | ds_graph_options (optional) 106 | |
107 |
108 | Dictionary of graphing options. This must be a dictionary of DS_id. 109 | Each element of the dictionary contains graphing options. See 110 | Flot documentation 111 | for more details. 112 |The recognized elements and the default values are: 113 | 114 | { 115 | title: label or ds_name // this is what is displayed in the checkboxes 116 | checked: first_ds_in_list? // boolean 117 | label: title or ds_name // this is what is displayed in the legend 118 | color: ds_index // see Flot docs for details 119 | lines: { show:true } // see Flot docs for details 120 | yaxis: 1 // can be 1 or 2 121 | stack: 'none' // other options are 'positive' and 'negative' 122 | } 123 |124 | |
125 |
Once instatiated, the object will automatically draw the plot and handle user interaction.
129 | 130 | 131 | -------------------------------------------------------------------------------- /doc/lib/rrdMultiFile_js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
31 | 32 | The rrdMultiFile 33 | Javascript module implements a set of classes that can be used 34 | to combine several RRDFile 35 | objects into one. They all implement the same interface as 36 | RRDFile. 37 |38 | |
39 |
The main class in this module is RRDFileSum. 43 | Given a list of similar RRDFile 44 | objects, it creates a new object that behaves like a RRDFile 45 | object where the input shave been summed up.
46 |This is the main class of the package. It is also the only class 48 | the user ever needs to explicitly instantiate.
49 |The RRDFileSum constructor has two argument:
50 |A list of similar RRDFile
52 | objects.
They must all have the same DSes and the same RRAs.
A boolean (default=true) – This value defines how to treat 54 | undefined values. If true, they are counted as zeros and the sum 55 | will always succeed. If it is false, any undefined value in one of 56 | the input objects will result in the sum being marked as undefined.
57 |This class implements the same interface as RRDFile.
59 |This class implements the same interface as RRDRRA.
61 |
64 | 65 | This module is part of the javascriptRRD
66 | package hosted at http://javascript.sourceforge.net.
67 | 71 | |
72 |
75 |
23 | 24 | The javascriptRRD package
25 | is hosted at http://javascript.sourceforge.net.
26 | 31 | |
32 |
Javascript needed for this page to work | ||||||||||||||||||||
RRD file | None |
Javascript needed for this page to work | ||||||||||||||||||||
RRD file | None | None |
Javascript needed for this page to work | ||||||||||||||||||||
RRD file | None |