Skip to content

Commit f4c244c

Browse files
authored
Merge pull request #20777 from Justin-ZS/fix/20774
fix(axis):null value item on category axis should be able to show tooltip
2 parents 9afb1c4 + 6319d56 commit f4c244c

File tree

4 files changed

+89
-1
lines changed

4 files changed

+89
-1
lines changed

src/scale/Ordinal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class OrdinalScale extends Scale<OrdinalScaleSetting> {
143143
contain(rank: OrdinalRawValue | OrdinalNumber): boolean {
144144
rank = this.parse(rank);
145145
return scaleHelper.contain(rank, this._extent)
146-
&& this._ordinalMeta.categories[rank] != null;
146+
&& rank >= 0 && rank < this._ordinalMeta.categories.length;
147147
}
148148

149149
/**

test/axis-dataset-null.html

Lines changed: 86 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/runTest/actions/__meta__.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/runTest/actions/axis-dataset-null.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)