diff --git a/src/app/directives/spectrumPicker.js b/src/app/directives/spectrumPicker.js index daec6b043aa..c6d3de6f884 100644 --- a/src/app/directives/spectrumPicker.js +++ b/src/app/directives/spectrumPicker.js @@ -32,7 +32,11 @@ function (angular) { }; input.spectrum(options); + + scope.$on('$destroy', function() { + input.spectrum('destroy'); + }); } }; }); -}); \ No newline at end of file +}); diff --git a/src/app/panels/graph/module.js b/src/app/panels/graph/module.js index ae50e372c7c..9afb77fd947 100644 --- a/src/app/panels/graph/module.js +++ b/src/app/panels/graph/module.js @@ -347,7 +347,6 @@ function (angular, app, $, _, kbn, moment, TimeSeries) { $scope.render(); }; - panelSrv.init($scope); }); diff --git a/src/app/panels/stats/module.js b/src/app/panels/stats/module.js index f85a1df62e5..1705fd0b9bd 100644 --- a/src/app/panels/stats/module.js +++ b/src/app/panels/stats/module.js @@ -43,6 +43,9 @@ function (angular, app, _, TimeSeries, kbn) { prefix: '', postfix: '', valueName: 'avg', + prefixFontSize: '50%', + valueFontSize: '100%', + postfixFontSize: '50%', thresholds: '', colorBackground: false, colorValue: false, diff --git a/src/app/panels/stats/statsDirective.js b/src/app/panels/stats/statsDirective.js index cc8b1c43e6a..7049471b999 100644 --- a/src/app/panels/stats/statsDirective.js +++ b/src/app/panels/stats/statsDirective.js @@ -17,11 +17,12 @@ function (angular, app, _, kbn, $) { return { link: function(scope, elem) { - var data; + var data, panel; var $panelContainer = elem.parents('.panel-container'); scope.$on('render', function() { data = scope.data; + panel = scope.panel; if (!data || data.flotpairs.length === 0) { elem.html('no data'); @@ -33,12 +34,12 @@ function (angular, app, _, kbn, $) { function setElementHeight() { try { - var height = scope.height || scope.panel.height || scope.row.height; + var height = scope.height || panel.height || scope.row.height; if (_.isString(height)) { height = parseInt(height.replace('px', ''), 10); } - height -= scope.panel.title ? 24 : 9; // subtract panel title bar + height -= panel.title ? 24 : 9; // subtract panel title bar elem.css('height', height + 'px'); @@ -49,7 +50,7 @@ function (angular, app, _, kbn, $) { } function applyColoringThresholds(value, valueString) { - if (!scope.panel.colorValue) { + if (!panel.colorValue) { return valueString; } @@ -70,8 +71,24 @@ function (angular, app, _, kbn, $) { return null; } + function getSpan(className, fontSize, value) { + return '' + + value + ''; + } + function getBigValueHtml() { - return applyColoringThresholds(data.mainValue, data.mainValueFormated); + var body = '