Ver código fonte

added unit (y axis format) mapping support for png renderer (#22)

Torkel Ödegaard 12 anos atrás
pai
commit
d90f2537a4
1 arquivos alterados com 12 adições e 0 exclusões
  1. 12 0
      src/app/directives/grafanaGraph.js

+ 12 - 0
src/app/directives/grafanaGraph.js

@@ -180,6 +180,18 @@ function (angular, $, kbn, moment, _) {
           url += scope.panel['x-axis'] ? '' : '&hideAxes=true';
           url += scope.panel['y-axis'] ? '' : '&hideYAxis=true';
 
+          switch(scope.panel.y_format) {
+          case 'bytes':
+            url += '&yUnitSystem=binary';
+            break;
+          case 'short':
+            url += '&yUnitSystem=si';
+            break;
+          case 'none':
+            url += '&yUnitSystem=none';
+            break;
+          }
+
           switch(scope.panel.nullPointMode) {
           case 'connected':
             url += '&lineMode=connected';