mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-07-31 17:53:45 +00:00
Initial commit
This commit is contained in:
49
app/static/global/plugins/morris/examples/updating.html
Normal file
49
app/static/global/plugins/morris/examples/updating.html
Normal file
@@ -0,0 +1,49 @@
|
||||
<!doctype html>
|
||||
<head>
|
||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
|
||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.2/raphael-min.js"></script>
|
||||
<script src="../morris.js"></script>
|
||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/prettify/r224/prettify.min.js"></script>
|
||||
<script src="lib/example.js"></script>
|
||||
<link rel="stylesheet" href="lib/example.css">
|
||||
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/prettify/r224/prettify.min.css">
|
||||
<link rel="stylesheet" href="../morris.css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Updating data</h1>
|
||||
<div id="graph"></div>
|
||||
<div id="reloadStatus">
|
||||
<pre id="code" class="prettyprint linenums">
|
||||
|
||||
var nReloads = 0;
|
||||
function data(offset) {
|
||||
var ret = [];
|
||||
for (var x = 0; x <= 360; x += 10) {
|
||||
var v = (offset + x) % 360;
|
||||
ret.push({
|
||||
x: x,
|
||||
y: Math.sin(Math.PI * v / 180).toFixed(4),
|
||||
z: Math.cos(Math.PI * v / 180).toFixed(4)
|
||||
});
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
var graph = Morris.Line({
|
||||
element: 'graph',
|
||||
data: data(0),
|
||||
xkey: 'x',
|
||||
ykeys: ['y', 'z'],
|
||||
labels: ['sin()', 'cos()'],
|
||||
parseTime: false,
|
||||
ymin: -1.0,
|
||||
ymax: 1.0,
|
||||
hideHover: true
|
||||
});
|
||||
function update() {
|
||||
nReloads++;
|
||||
graph.setData(data(5 * nReloads));
|
||||
$('#reloadStatus').text(nReloads + ' reloads');
|
||||
}
|
||||
setInterval(update, 100);
|
||||
</pre>
|
||||
</body>
|
Reference in New Issue
Block a user