diff --git a/assets/js/site.js b/assets/js/site.js index d9c459e..8a1590e 100644 --- a/assets/js/site.js +++ b/assets/js/site.js @@ -277,11 +277,27 @@ $(document).ready(function() { }); socket.on('historyGraph', function(rawData) { - displayedGraphData = rawData; + var shownServers = loadGraphControls(); + + if (shownServers) { + var keys = Object.keys(rawData); + + for (var i = 0; i < keys.length; i++) { + var name = keys[i]; + + if (shownServers.indexOf(name) !== -1) { + displayedGraphData[name] = rawData[name]; + } else { + hiddenGraphData[name] = rawData[name]; + } + } + } else { + displayedGraphData = rawData; + } $('#big-graph').css('height', '400px'); - historyPlot = $.plot('#big-graph', convertGraphData(rawData), bigChartOptions); + historyPlot = $.plot('#big-graph', convertGraphData(displayedGraphData), bigChartOptions); $('#big-graph').bind('plothover', handlePlotHover); @@ -293,7 +309,13 @@ $(document).ready(function() { keys.sort(); for (var i = 0; i < keys.length; i++) { - html += '