Skip to content

Commit

Permalink
fix(line): 修复设置 line 宽度无效 (#1338)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshmyw committed Jan 10, 2022
1 parent 8fea790 commit 79621d1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/f2/src/components/line/lineView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ export default (props: LineViewProps) => {
return { x: point.x, y: point.y };
}),
stroke: color,
lineWidth: size,
...shape,
lineWidth: size || shape.lineWidth,
}}
animation={deepMix({
update: {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions packages/f2/test/components/line/line.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1191,5 +1191,32 @@ describe('折线图', () => {
const canvas = new Canvas(props);
canvas.render();
});

it('指定线宽', async () => {
const BASE = '指定线宽';
const context = createContext(BASE);
const { type, props } = (
<Canvas
context={context}
pixelRatio={1}
>
<Chart data={data}>
<Axis
field="date"
tickCount={3}
/>
<Axis field="value" tickCount={5} />
<Line size="6px" x="date" y="value" />
</Chart>
</Canvas>
);

const canvas = new Canvas(props);
canvas.render();
await delay(1000);
expect(context).toMatchImageSnapshot();
});

});

});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 79621d1

Please sign in to comment.