Skip to content

fix(radar): distinguish missing dimensions from zero - #21741

Open
tianrking wants to merge 1 commit into
apache:masterfrom
tianrking:codex/fix-20811-radar-null-values
Open

fix(radar): distinguish missing dimensions from zero#21741
tianrking wants to merge 1 commit into
apache:masterfrom
tianrking:codex/fix-20811-radar-null-values

Conversation

@tianrking

Copy link
Copy Markdown

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

This PR keeps missing radar dimensions absent from the rendered geometry instead of drawing them as real zero values at the radar center.

Fixed issues

Details

Before: What was the problem?

Radar layout replaced null, undefined, NaN, and '-' values with the coordinate-system center before rendering. This made missing observations indistinguishable from actual numeric zeroes: they changed the polygon shape, produced symbols at the center, and could visually suggest measurements that were never present.

The center fallback originally protected the generic polygon renderer from NaN coordinates, so simply removing it would reintroduce unstable path and animation behavior.

After: How does it behave after the fixing?

The layout now preserves one point per radar dimension and represents missing dimensions with invalid coordinates. Radar-specific polyline and polygon paths filter those coordinates only at the path-building boundary, retaining fixed-dimension shapes for animation while connecting neighboring valid dimensions without passing NaN values to the renderer.

Symbols are created only for valid dimensions. A real numeric zero still renders at the center, all-missing data renders no series geometry, tooltip values remain unchanged, and complete numeric radar data follows the existing fast path.

Document Info

One of the following should be checked.

  • This PR doesn't relate to document changes
  • The document should be updated later
  • The document changes have been made in apache/echarts-doc#xxx

Misc

Security Checking

  • This PR uses security-sensitive Web APIs.

ZRender Changes

  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

  • test/ut/spec/series/radar.test.ts covers mixed missing values, real zeroes, path construction, symbols, tooltip data, all-missing input, updates that move the missing dimensions, and the unchanged complete-data path.
  • test/radar-missing-value.html provides side-by-side visual cases for partial and all-missing data.

Merging options

  • Please squash the commits into a single one when merging.

Other information

Validation performed on Node.js 20.20.2:

  • npm test -- --runInBand (27 suites, 198 tests)
  • npm run lint
  • npm run checktype
  • npm run test:dts (TypeScript 4.7 through 5.9)
  • npm run release
  • Chrome 151 browser verification of the visual case with both Canvas and SVG renderers, including path-command, symbol, and console-error assertions

AI assistance (OpenAI Codex) was used for issue analysis, implementation, test authoring, and local verification. I reviewed and understand the complete change and the validation above.

@echarts-bot

echarts-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

Please DO NOT commit the files in dist, i18n, and ssr/client/dist folders in a non-release pull request. These folders are for release use only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] null value for radar series

1 participant