Skip to content

Commit 6717a37

Browse files
authored
Merge pull request #3904 from VisActor/fix/crosshari-defaultSelect-axisIndex
Fix/crosshari default select axis index
2 parents e880277 + 198f843 commit 6717a37

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "fix: when set defaultSelect of crosshair, `axisIndex` should have a default value: 0\n\n",
5+
"type": "none",
6+
"packageName": "@visactor/vchart"
7+
}
8+
],
9+
"packageName": "@visactor/vchart",
10+
"email": "dingling112@gmail.com"
11+
}

packages/vchart/src/component/crosshair/base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export abstract class BaseCrossHair<T extends ICartesianCrosshairSpec | IPolarCr
162162
const fieldSpec = (this._spec as any)[field];
163163

164164
if (fieldSpec && fieldSpec.visible && fieldSpec.defaultSelect) {
165-
const { axisIndex, datum } = fieldSpec.defaultSelect;
165+
const { axisIndex = 0, datum } = fieldSpec.defaultSelect;
166166
const axis = this._option.getComponentsByKey('axes').find(c => c.getSpecIndex() === axisIndex) as IAxis;
167167

168168
if (axis) {

0 commit comments

Comments
 (0)