mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
graph: dashes with linewidth fix. Fixes #8469
Adds series override options for dash spaces and dash length.
This commit is contained in:
parent
8422697199
commit
3292a48381
@ -87,9 +87,11 @@ export default class TimeSeries {
|
||||
if (override.fill !== void 0) { this.lines.fill = translateFillOption(override.fill); }
|
||||
if (override.stack !== void 0) { this.stack = override.stack; }
|
||||
if (override.linewidth !== void 0) {
|
||||
this.lines.lineWidth = override.linewidth;
|
||||
this.lines.lineWidth = this.dashes.show ? 0: override.linewidth;
|
||||
this.dashes.lineWidth = override.linewidth;
|
||||
}
|
||||
if (override.dashLength !== void 0) { this.dashes.dashLength[0] = override.dashLength; }
|
||||
if (override.spaceLength !== void 0) { this.dashes.dashLength[1] = override.spaceLength; }
|
||||
if (override.nullPointMode !== void 0) { this.nullPointMode = override.nullPointMode; }
|
||||
if (override.pointradius !== void 0) { this.points.radius = override.pointradius; }
|
||||
if (override.steppedLine !== void 0) { this.lines.steps = override.steppedLine; }
|
||||
|
@ -101,6 +101,8 @@ define([
|
||||
$scope.addOverrideOption('Fill below to', 'fillBelowTo', $scope.getSeriesNames());
|
||||
$scope.addOverrideOption('Staircase line', 'steppedLine', [true, false]);
|
||||
$scope.addOverrideOption('Dashes', 'dashes', [true, false]);
|
||||
$scope.addOverrideOption('Dash Length', 'dashLength', [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]);
|
||||
$scope.addOverrideOption('Dash Space', 'spaceLength', [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]);
|
||||
$scope.addOverrideOption('Points', 'points', [true, false]);
|
||||
$scope.addOverrideOption('Points Radius', 'pointradius', [1,2,3,4,5]);
|
||||
$scope.addOverrideOption('Stack', 'stack', [true, false, 'A', 'B', 'C', 'D']);
|
||||
|
@ -211,6 +211,19 @@ define([
|
||||
});
|
||||
});
|
||||
|
||||
describe('series option overrides, dashes and lineWidth', function() {
|
||||
beforeEach(function() {
|
||||
series.alias = 'test';
|
||||
series.applySeriesOverrides([{ alias: 'test', linewidth: 5, dashes: true }]);
|
||||
});
|
||||
|
||||
it('should enable dashes, set dashes lineWidth to 5 and lines lineWidth to 0', function() {
|
||||
expect(series.dashes.show).to.be(true);
|
||||
expect(series.dashes.lineWidth).to.be(5);
|
||||
expect(series.lines.lineWidth).to.be(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('series option overrides, fill below to', function() {
|
||||
beforeEach(function() {
|
||||
series.alias = 'test';
|
||||
|
Loading…
Reference in New Issue
Block a user