Skip to content

Commit 774c209

Browse files
author
quao
committed
enha 数值校验
1 parent c6eea0e commit 774c209

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/coord/cartesian/Grid.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,8 @@ class Grid implements CoordinateSystemMaster {
568568
axisType: OptionAxisType,
569569
): void {
570570
const includeMarkerInExtent = axis.model.get('includeMarkerInExtent') ?? false;
571-
if (includeMarkerInExtent && value != null && typeof value !== 'string' && axisType !== 'category') {
571+
const isValidNumber = typeof value === 'number' && !isNaN(value);
572+
if (includeMarkerInExtent && isValidNumber && axisType !== 'category') {
572573
const val = axis.scale.parse(value);
573574
if (!isNaN(val)) {
574575
axis.scale.unionExtentByValue(val);

0 commit comments

Comments
 (0)