Skip to content

Commit 32fb46b

Browse files
author
anhaohui.ahh
committed
fix: thumbnail of dual-axes are out of sync
1 parent 0b5a9af commit 32fb46b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

__tests__/unit/plots/bullet/index-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ describe('bullet', () => {
134134
xField: 'title',
135135
yField: 'measures',
136136
});
137-
expect(measureGeometry.getAttribute('color').values).toEqual('#ff0000');
137+
expect(measureGeometry.getAttribute('color').values).toEqual('#000000');
138138

139139
bullet.destroy();
140140
});

src/plots/dual-axes/util/render-sider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export const doSliderFilter = (view: View, sliderValue: [number, number]) => {
2121
const values = valuesOfKey(data, xScale.field);
2222
const xValues = isHorizontal ? values : values.reverse();
2323
const xTickCount = size(xValues);
24-
const minIndex = Math.floor(min * (xTickCount - 1));
25-
const maxIndex = Math.floor(max * (xTickCount - 1));
24+
const minIndex = Math.round(min * (xTickCount - 1));
25+
const maxIndex = Math.round(max * (xTickCount - 1));
2626

2727
// 增加 x 轴的过滤器
2828
view.filter(xScale.field, (value: any) => {

0 commit comments

Comments
 (0)