Debian Codegraph @

examples/threshold/index.html

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5 <title>Flot Examples: Thresholds</title>
6 <link href="../examples.css" rel="stylesheet" type="text/css">
7 <script language="javascript" type="text/javascript" src="../../source/jquery.js"></script>
8 <script language="javascript" type="text/javascript" src="../../source/jquery.canvaswrapper.js"></script>
9 <script language="javascript" type="text/javascript" src="../../source/jquery.colorhelpers.js"></script>
10 <script language="javascript" type="text/javascript" src="../../source/jquery.flot.js"></script>
11 <script language="javascript" type="text/javascript" src="../../source/jquery.flot.saturated.js"></script>
12 <script language="javascript" type="text/javascript" src="../../source/jquery.flot.browser.js"></script>
13 <script language="javascript" type="text/javascript" src="../../source/jquery.flot.drawSeries.js"></script>
14 <script language="javascript" type="text/javascript" src="../../source/jquery.flot.uiConstants.js"></script>
15 <script language="javascript" type="text/javascript" src="../../source/jquery.flot.threshold.js"></script>
16 <script type="text/javascript">
17
18 $(function() {
19
20 var d1 = [];
21 for (var i = 0; i <= 60; i += 1) {
22 d1.push([i, parseInt(Math.random() * 30 - 10)]);
23 }
24
25 function plotWithOptions(t) {
26 $.plot("#placeholder", [{
27 data: d1,
28 color: "rgb(30, 180, 20)",
29 threshold: {
30 below: t,
31 color: "rgb(200, 20, 30)"
32 },
33 lines: {
34 steps: true
35 }
36 }]);
37 }
38
39 plotWithOptions(0);
40
41 $(".controls button").click(function (e) {
42 e.preventDefault();
43 var t = parseFloat($(this).text().replace("Threshold at ", ""));
44 plotWithOptions(t);
45 });
46
47 // Add the Flot version string to the footer
48
49 $("#footer").prepend("Flot " + $.plot.version + " &ndash; ");
50 });
51
52 </script>
53 </head>
54 <body>
55
56 <div id="header">
57 <h2>Thresholds</h2>
58 </div>
59
60 <div id="content">
61
62 <div class="demo-container">
63 <div id="placeholder" class="demo-placeholder"></div>
64 </div>
65
66 <p>With the threshold plugin, you can apply a specific color to the part of a data series below a threshold. This is can be useful for highlighting negative values, e.g. when displaying net results or what's in stock.</p>
67
68 <p class="controls">
69 <button>Threshold at 5</button>
70 <button>Threshold at 0</button>
71 <button>Threshold at -2.5</button>
72 </p>
73
74 </div>
75
76 <div id="footer">
77 Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
78 </div>
79
80 </body>
81 </html>