summaryrefslogtreecommitdiff
path: root/datastore-leveldb
diff options
context:
space:
mode:
Diffstat (limited to 'datastore-leveldb')
-rw-r--r--datastore-leveldb/wwwroot_ebus/src/ebus.js37
1 files changed, 36 insertions, 1 deletions
diff --git a/datastore-leveldb/wwwroot_ebus/src/ebus.js b/datastore-leveldb/wwwroot_ebus/src/ebus.js
index eb0cb2d..7c59025 100644
--- a/datastore-leveldb/wwwroot_ebus/src/ebus.js
+++ b/datastore-leveldb/wwwroot_ebus/src/ebus.js
@@ -261,7 +261,8 @@ plotDetail = $.plot($("#ebusgraph"),
max:timeToLocal(to),
panRange: [timeToLocal(fromOverview), timeToLocal(toOverview)]
},
- yaxis: { min: -16, max: 100, panRange: [-16,100] },
+ grid: { hoverable: true},
+ yaxis: { min: -16, max: 100, panRange: [-50,300] },
pan: {
interactive: true,
frameRate: 16,
@@ -279,6 +280,40 @@ $("#ebusgraph").bind('plotpan', function (event, plot) {
update_range(Math.round(axes.xaxis.min), Math.round(axes.xaxis.max));
});
+$(window).resize(function() {
+ plotDetail.resize();
+ plotDetail.setupGrid();
+ plotDetail.draw();
+ plotOverview.resize();
+ plotOverview.setupGrid();
+ plotOverview.draw();
+});
+
+$("#ebusgraph").bind("plothover", function (event, pos, item) {
+ function showTooltip(x, y, series, time, value) {
+ $('<div>').css( {
+ position: 'absolute',
+ display: 'none',
+ top: y + 5,
+ left: x + 5,
+ border: '1px solid #fdd',
+ padding: '2px',
+ 'background-color': '#fee',
+ opacity: 0.80
+ })
+ .append($('<p>').text(series))
+ .append($('<p>').text(time.toLocaleDateString() + " " + time.toLocaleTimeString()))
+ .append($('<p>').text(value))
+ .addClass("tooltip").appendTo("#ebusgraph").fadeIn(100);
+ }
+ $("#ebusgraph .tooltip").remove();
+ if (item) {
+ var x = item.datapoint[0].toFixed(2);
+ var y = item.datapoint[1].toFixed(2);
+ showTooltip(item.pageX, item.pageY, item.series.label, new Date(Math.ceil(x)), y);
+ }
+});
+
plotOverview = $.plot($("#overview"),
datasetOverview,
{ // options