diff options
Diffstat (limited to 'src/examples')
-rw-r--r-- | src/examples/rrdJFlotThree.html | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/src/examples/rrdJFlotThree.html b/src/examples/rrdJFlotThree.html new file mode 100644 index 0000000..bb5998b --- /dev/null +++ b/src/examples/rrdJFlotThree.html @@ -0,0 +1,79 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<!-- + Example HTML/javascript file that display the + content of three RRD archive files in a graph + using the Flot libraries + Part of the javascriptRRD package + Copyright (c) 2013 Igor Sfiligoi, isfiligoi@ucsd.edu + + Original repository: http://javascriptrrd.sourceforge.net/ + + MIT License [http://www.opensource.org/licenses/mit-license.php] + +--> + +<!-- + This page requires Flot. + + Repository: http://www.flotcharts.org/ + [Previous repository: http://code.google.com/p/flot/] + +--> + +<html> + + <script type="text/javascript" src="../lib/javascriptrrd.wlibs.js"></script> + <!-- the above script replaces the rrdfFlotAsync,rrdFlot, rrdFlotSelection, rrdFile, rrdMultiFile, binaryXHR and all the jquery libraries --> + <head> + <title>RRD Graphs with Flot</title> + </head> + + <body> + <h1 id="title">RRD Graphs with Flot</h1> + + RRD URL: + <input type="text" id="input_fname1" value="example4_s1.rrd"><br> + <input type="text" id="input_fname2" value="example4_s2.rrd"><br> + <input type="text" id="input_fname3" value="example4_s3.rrd"><br> + <button onclick="fname_update()">Update</button> + <hr> + + <table id="infotable" border=1> + <tr><td colspan="21"><b>Javascript needed for this page to work</b></td></tr> + <tr><td><b>RRD file</b></td><td id="fname1" colspan="2">None</td><td id="fname2" colspan="3">None</td><td id="fname3" colspan="3">None</td></tr> + </table> + + <div id="mygraph"></div> + + <script type="text/javascript"> + + // Remove the Javascript warning + document.getElementById("infotable").deleteRow(0); + + var graph_opts={legend: { noColumns:4}}; + var ds_graph_opts={'Oscilator':{ color: "#ff8000", + lines: { show: true, fill: true, fillColor:"#ffff80"} }, + 'Idle':{ label: 'IdleJobs', color: "#00c0c0", + lines: { show: true, fill: true} }, + 'Running':{color: "#000000",yaxis:2}, + 'ClientGlideTotal':{title: 'Running glidein jobs', label:'Running',color: "#00f800", checked:true, + lines: { show: true, fill: true, fillColor:"#00ff00"}}}; + + // the rrdFlot object creates and handles the graph + flot_obj=new rrdFlotSumAsync("mygraph",null,graph_opts,ds_graph_opts); + + // this function is invoked when the RRD file name changes + function fname_update() { + var fname1=document.getElementById("input_fname1").value; + var fname2=document.getElementById("input_fname2").value; + var fname3=document.getElementById("input_fname3").value; + flot_obj.reload([fname1,fname2,fname3]); + document.getElementById("fname1").firstChild.data=fname1; + document.getElementById("fname2").firstChild.data=fname2; + document.getElementById("fname3").firstChild.data=fname3; + } + + + </script> + </body> +</html> |