git.ucc.asn.au
/
matches
/
MCTX3420.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add crappy download link (not really)
[matches/MCTX3420.git]
/
testing
/
MCTXWeb
/
public_html
/
static
/
mctx.graph.js
diff --git
a/testing/MCTXWeb/public_html/static/mctx.graph.js
b/testing/MCTXWeb/public_html/static/mctx.graph.js
index
687db84
..
b91eab3
100644
(file)
--- a/
testing/MCTXWeb/public_html/static/mctx.graph.js
+++ b/
testing/MCTXWeb/public_html/static/mctx.graph.js
@@
-15,6
+15,7
@@
mctx.graph.dependent = null;
mctx.graph.independent = null;
mctx.graph.timer = null;
mctx.graph.running = false;
mctx.graph.independent = null;
mctx.graph.timer = null;
mctx.graph.running = false;
+mctx.graph.chart = null;
/**
* Helper - Calculate pairs of (dependent, independent) values
/**
* Helper - Calculate pairs of (dependent, independent) values
@@
-89,7
+90,7
@@
$.fn.setDevices = function() {
$("#xaxis").deployDevices("radio", false, 'xaxis');
$("#yaxis").deployDevices("checkbox", true, 'yaxis');
$("#current_time").val(data.running_time);
$("#xaxis").deployDevices("radio", false, 'xaxis');
$("#yaxis").deployDevices("checkbox", true, 'yaxis');
$("#current_time").val(data.running_time);
- //Add event listeners for when the
inputs are changed
+ //Add event listeners for when the
$(".change input").change(function () {
$("#graph").setGraph();
});
$(".change input").change(function () {
$("#graph").setGraph();
});
@@
-164,7
+165,14
@@
function graphUpdater() {
}
});
}
});
- $.plot("#graph", plot_data);
+ //$.plot("#graph", plot_data);
+ if (mctx.graph.chart !== null) {
+ mctx.graph.chart.setData(plot_data);
+ mctx.graph.chart.setupGrid();
+ mctx.graph.chart.draw();
+ } else {
+ mctx.graph.chart = $.plot("#graph", plot_data);
+ }
if (mctx.graph.running) {
mctx.graph.timer = setTimeout(updater, 1000);
}
if (mctx.graph.running) {
mctx.graph.timer = setTimeout(updater, 1000);
}
UCC
git Repository :: git.ucc.asn.au