Commit 3292a483 by Daniel Lee

graph: dashes with linewidth fix. Fixes #8469

Adds series override options for dash spaces and dash length.
parent 84226971
......@@ -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';
......
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