Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(1758): 面积图 line.color 设置不生效的问题 #1759

Merged
merged 1 commit into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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