diff options
author | Ebus-at-dockstar <ebus@dockstar> | 2014-09-19 22:07:46 +0200 |
---|---|---|
committer | Ebus-at-dockstar <ebus@dockstar> | 2014-09-19 22:07:46 +0200 |
commit | a21f4f23e847e09d801c44c16772191a8f1e35b1 (patch) | |
tree | 2df2875a3494462878116dfd84abdd616af1748e /datastore-leveldb/wwwroot_ebus | |
parent | b0fdb14b806f346808248d00eb5f6e24edec5167 (diff) | |
download | ebus-alt-a21f4f23e847e09d801c44c16772191a8f1e35b1.tar.gz ebus-alt-a21f4f23e847e09d801c44c16772191a8f1e35b1.zip |
resize
Diffstat (limited to 'datastore-leveldb/wwwroot_ebus')
-rw-r--r-- | datastore-leveldb/wwwroot_ebus/src/ebus.js | 37 |
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 |