Skip to content

Commit d8ea8e1

Browse files
committed
fix: fix chart picker logic
1 parent 3c95aee commit d8ea8e1

2 files changed

Lines changed: 6 additions & 16 deletions

File tree

packages/vtable/examples/pivot-chart/pivotChart.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9422,10 +9422,10 @@ export function createTable() {
94229422
cellBgColor: ''
94239423
}
94249424
},
9425-
selectionStyle: {
9426-
cellBgColor: '',
9427-
cellBorderColor: ''
9428-
},
9425+
// selectionStyle: {
9426+
// cellBgColor: '',
9427+
// cellBorderColor: ''
9428+
// },
94299429
frameStyle: {
94309430
borderLineWidth: 0
94319431
},

packages/vtable/src/scenegraph/graphic/contributions/vchart-graphic-picker.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,9 @@ export class VChartPicker implements IGraphicPicker {
99
numberType: number = CHART_NUMBER_TYPE;
1010

1111
contains(chart: any, point: any, params?: IPickParams): boolean | any {
12-
const vChart = (chart as VChartGraphic).activeChartInstance;
13-
if (!vChart) {
12+
if (!chart.AABBBounds.containsPoint(point)) {
1413
return false;
1514
}
16-
// 得到 vchart stage
17-
const vchartStage = vChart.getStage();
18-
vchartStage.dirtyBounds?.clear();
19-
// 因为vchart 在 vtable 内始坐标变换始终等于在group中的坐标变换,所以这里不需要再做坐标转换
20-
const pick = vchartStage.pick(point.x, point.y);
21-
// @ts-ignore
22-
if (pick.graphic === null && pick.group.name === 'root') {
23-
return false;
24-
}
25-
return pick;
15+
return true;
2616
}
2717
}

0 commit comments

Comments
 (0)