Commit 4a9bc70c by Torkel Ödegaard

Added new style override, transform negative-Y, Closes #2162

parent 48175101
......@@ -6,6 +6,7 @@
- [Issue #1888](https://github.com/grafana/grafana/issues/1144). Templating: Repeat panel or row for each selected template variable value
- [Issue #1888](https://github.com/grafana/grafana/issues/1944). Dashboard: Custom Navigation links & dynamic links to related dashboards
- [Issue #590](https://github.com/grafana/grafana/issues/590). Graph: Define series color using regex rule
- [Issue #2162](https://github.com/grafana/grafana/issues/2162). Graph: New series style override, negative-y transform and stack groups
- [Issue #2096](https://github.com/grafana/grafana/issues/2096). Dashboard list panel: Now supports search by multiple tags
**User or Organization admin**
......
......@@ -54,6 +54,7 @@ function (_, kbn) {
if (override.zindex !== void 0) { this.zindex = override.zindex; }
if (override.fillBelowTo !== void 0) { this.fillBelowTo = override.fillBelowTo; }
if (override.color !== void 0) { this.color = override.color; }
if (override.transform !== void 0) { this.transform = override.transform; }
if (override.yaxis !== void 0) {
this.yaxis = override.yaxis;
......
......@@ -99,10 +99,11 @@ define([
$scope.addOverrideOption('Staircase line', 'steppedLine', [true, false]);
$scope.addOverrideOption('Points', 'points', [true, false]);
$scope.addOverrideOption('Points Radius', 'pointradius', [1,2,3,4,5]);
$scope.addOverrideOption('Stack', 'stack', [true, false, 2, 3, 4, 5]);
$scope.addOverrideOption('Stack', 'stack', [true, false, 'A', 'B', 'C', 'D']);
$scope.addOverrideOption('Color', 'color', ['change']);
$scope.addOverrideOption('Y-axis', 'yaxis', [1, 2]);
$scope.addOverrideOption('Z-index', 'zindex', [-1,-2,-3,0,1,2,3]);
$scope.addOverrideOption('Transform', 'transform', ['negative-Y']);
$scope.updateCurrentOverrides();
});
......
......@@ -1226,6 +1226,19 @@ Licensed under the MIT license.
// give the hooks a chance to run
for (i = 0; i < series.length; ++i) {
s = series[i];
points = s.datapoints.points;
ps = s.datapoints.pointsize;
// grafana
if (s.transform === 'negative-Y') {
for (j = 0; j < points.length; j += ps) {
if (points[j] == null)
continue;
val = points[j + 1];
points[j + 1] = -val;
}
}
executeHooks(hooks.processDatapoints, [ s, s.datapoints]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment