Skip to content

Commit

Permalink
fix: thumbnail of dual-axes are out of sync
Browse files Browse the repository at this point in the history
  • Loading branch information
anhaohui.ahh committed Oct 15, 2024
1 parent 0b5a9af commit 32fb46b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion __tests__/unit/plots/bullet/index-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ describe('bullet', () => {
xField: 'title',
yField: 'measures',
});
expect(measureGeometry.getAttribute('color').values).toEqual('#ff0000');
expect(measureGeometry.getAttribute('color').values).toEqual('#000000');

bullet.destroy();
});
Expand Down
4 changes: 2 additions & 2 deletions src/plots/dual-axes/util/render-sider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export const doSliderFilter = (view: View, sliderValue: [number, number]) => {
const values = valuesOfKey(data, xScale.field);
const xValues = isHorizontal ? values : values.reverse();
const xTickCount = size(xValues);
const minIndex = Math.floor(min * (xTickCount - 1));
const maxIndex = Math.floor(max * (xTickCount - 1));
const minIndex = Math.round(min * (xTickCount - 1));
const maxIndex = Math.round(max * (xTickCount - 1));

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

0 comments on commit 32fb46b

Please sign in to comment.