Skip to content

Commit

Permalink
fix(1758): 面积图 line.color 设置不生效的问题 (#1759)
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcc authored Oct 21, 2020
1 parent 72e10eb commit da311cc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
21 changes: 21 additions & 0 deletions __tests__/bugs/issue-1758-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { TinyArea } from '../../src';
import { createDiv } from '../utils/dom';

describe('#1758', () => {
it('area line.color', () => {
const tinyArea = new TinyArea(createDiv('mini 面积图 color 配置不生效'), {
height: 60,
width: 300,
autoFit: false,
data: new Array(100).fill(0).map(() => Math.random() * 100),
smooth: true,
line: {
color: 'red',
},
});

tinyArea.render();

expect(tinyArea.chart.geometries[1].elements[0].container.getChildByIndex(0).attr('stroke')).toBe('red');
});
});
4 changes: 1 addition & 3 deletions src/plots/tiny-area/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ export class TinyArea extends Plot<TinyAreaOptions> {
},
line: {
size: 1,
style: {
stroke: '#5B8FF9',
},
color: '#5B8FF9',
},
};
}
Expand Down

0 comments on commit da311cc

Please sign in to comment.