Skip to content

Commit

Permalink
fix(area): 修复面积图中折线没有传入 seriesField (#2926)
Browse files Browse the repository at this point in the history
* fix(area): 修复面积图中折线没有传入 seriesField

* fix(area): 修复面积图单测问题
  • Loading branch information
visiky authored Oct 19, 2021
1 parent d5ce666 commit f096740
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __tests__/unit/plots/area/line-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('area', () => {
const point = area.chart.geometries.find((g: Geometry) => g.type === 'line');
expect(point.shapeType).toBe('line');
// @ts-ignore
expect(point.attributeOption.size.values).toEqual([2]);
expect(point.attributeOption.size.values).toEqual(2);
// @ts-ignore
// expect(point.attributeOption.shape.values).toEqual(['circle']);

Expand Down
5 changes: 4 additions & 1 deletion src/plots/area/adaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ function geometry(params: Params<AreaOptions>): Params<AreaOptions> {
},
},
});
const second = deepAssign({}, primary, { options: { tooltip: false } });
// 线默认 2px
const second = deepAssign({ options: { line: { size: 2 } } }, primary, {
options: { sizeField: seriesField, tooltip: false },
});
const pointParams = deepAssign({}, primary, { options: { tooltip: false, state: pointState } });

// area geometry 处理
Expand Down

0 comments on commit f096740

Please sign in to comment.