mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge branch 'stesie-fix-formatter-stack-percentage'
This commit is contained in:
commit
3868a796a4
@ -380,11 +380,11 @@ function (angular, $, moment, _, kbn, GraphTooltip) {
|
|||||||
options.yaxes.push(secondY);
|
options.yaxes.push(secondY);
|
||||||
|
|
||||||
applyLogScale(options.yaxes[1], data);
|
applyLogScale(options.yaxes[1], data);
|
||||||
configureAxisMode(options.yaxes[1], scope.panel.y_formats[1]);
|
configureAxisMode(options.yaxes[1], scope.panel.percentage && scope.panel.stack ? "percent" : scope.panel.y_formats[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
applyLogScale(options.yaxes[0], data);
|
applyLogScale(options.yaxes[0], data);
|
||||||
configureAxisMode(options.yaxes[0], scope.panel.y_formats[0]);
|
configureAxisMode(options.yaxes[0], scope.panel.percentage && scope.panel.stack ? "percent" : scope.panel.y_formats[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyLogScale(axis, data) {
|
function applyLogScale(axis, data) {
|
||||||
|
@ -215,6 +215,17 @@ define([
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
graphScenario('when stack and percent', function(ctx) {
|
||||||
|
ctx.setup(function(scope) {
|
||||||
|
scope.panel.percentage = true;
|
||||||
|
scope.panel.stack = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should show percentage', function() {
|
||||||
|
var axis = ctx.plotOptions.yaxes[0];
|
||||||
|
expect(axis.tickFormatter(100, axis)).to.be("100%");
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user