/* * Support library aimed at providing commonly used functions and classes * that may be used while plotting RRD files with Flot * * Part of the javascriptRRD package * Copyright (c) 2009 Frank Wuerthwein, fkw@ucsd.edu * * Original repository: http://javascriptrrd.sourceforge.net/ * * MIT License [http://www.opensource.org/licenses/mit-license.php] * */ /* * * Flot is a javascript plotting library developed and maintained by * Ole Laursen [http://code.google.com/p/flot/] * */ // Return a Flot-like data structure // Since Flot does not properly handle empty elements, min and max are returned, too function rrdDS2FlotSeries(rrd_file,ds_id,rra_idx,want_rounding) { var ds=rrd_file.getDS(ds_id); var ds_name=ds.getName(); var ds_idx=ds.getIdx(); var rra=rrd_file.getRRA(rra_idx); var rra_rows=rra.getNrRows(); var last_update=rrd_file.getLastUpdate(); var step=rra.getStep(); if (want_rounding!=false) { // round last_update to step // so that all elements are sync last_update-=(last_update%step); } var first_el=last_update-(rra_rows-1)*step; var timestamp=first_el; var flot_series=[]; for (var i=0;i no filtering var out_data=[]; for (var i=0; i=this.selection_min) && (nr<=this.selection_max)) { out_data.push(data_list[i]); } } return out_data; };