Visitar URL original
[Bug] null value for radar series · Issue #20811 · apache/echarts · GitHub
Skip to content

[Bug] null value for radar series #20811

Description

@skczjun

Version

5.2.2

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=line-simple

Steps to Reproduce

option = {
radar: {
// shape: 'circle',
indicator: [
{ name: 'Sales', max: 400 },
{ name: 'Administration', max: 400 },
{ name: 'Information Technology', max: 400 },
{ name: 'Customer Support', max: 400 },
{ name: 'Development', max: 400 },
{ name: 'Marketing', max: 400 }
]
},
series: [
{
type: 'radar',
data: [
{value: [150, undefined , 224, null, 135, 50]}
]
}
]
};

Image

Current Behavior

null,undefined当成了0来处理。

Expected Behavior

null,undefined直接按空值来处理,连线断开

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Activity

  1. added
    pendingWe are not sure about whether this is a bug/new feature.
    on Mar 7, 2025
  2. echarts-bot commented on Mar 7, 2025

    @echarts-bot

    @skczjun It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

    TRANSLATED

    TITLE

    [Bug] The null value of the radar chart is treated as 0

  3. helgasoft commented on Mar 7, 2025

    @helgasoft

    duplicate od #20654

    Expected Behavior: null and undefined are directly treated as null values, and the connection is disconnected

    Disconnecting lines in a radar chart would make it hard to read, I think. Maybe connecting to the next valid point would be more preferable, like so:
    Image

  4. skczjun commented on Mar 10, 2025

    @skczjun
    Author

    duplicate od #20654

    Expected Behavior: null and undefined are directly treated as null values, and the connection is disconnected

    Disconnecting lines in a radar chart would make it hard to read, I think. Maybe connecting to the next valid point would be more preferable, like so: Image

    "How to achieve this effect"

  5. Ovilia commented on Mar 10, 2025

    @Ovilia
    Contributor

    I think "connecting to the next valid point" should be misleading, especially when symbol size is small. From the definition of Radar series, where each indicator shows the value of a dimension, I think it's reasonable to display 0 for dimensions not available. So I would say this is "not-a-bug".

  6. added and removed
    pendingWe are not sure about whether this is a bug/new feature.
    on Mar 10, 2025
  7. Ovilia commented on Mar 10, 2025

    @Ovilia
    Contributor

    Consider using line series in polar system if you want to "connect to the next valid point" because if you have such requirement, your use case may probably not a "radar series".

  8. skczjun commented on Mar 12, 2025

    @skczjun
    Author

    Normally, a radar chart includes specific indicators. However, in certain cases, some indicators may not be available and thus have null values. These should not be simply treated as 0 because doing so would make it impossible to distinguish between actual zero values and missing data, which could represent anomalies. Given this issue, a new component library has been adopted to display the radar chart in order to better handle such scenarios where indicators might be missing or unavailable.
    
    This approach ensures that missing data points are appropriately represented without conflating them with valid zero values, thereby providing clearer insights into the underlying data and making it easier to identify potential anomalies. By switching to a more capable component library, you can implement more sophisticated handling of missing data, improving the accuracy and interpretability of your radar charts.
    
    If there is a need to display null values as 0, this can be achieved by modifying the data source or by providing a toggle in the component to allow users to decide whether null values should be shown as 0. This approach avoids a one-size-fits-all solution that automatically treats all null values as 0, giving users the flexibility to handle missing data according to their specific needs.
    
    This method ensures that users can choose the most appropriate way to represent missing data, either displaying null values as 0 when it makes sense for their use case, or leaving them as null to clearly indicate the absence of data. By offering such an option, the component becomes more versatile and better suited to different data visualization requirements.

  9. skczjun commented on Mar 13, 2025

    @skczjun
    Author

    Image
    This is the only reasonable display

  10. Ovilia commented on Mar 13, 2025

    @Ovilia
    Contributor

    The above demo seems reasonable. Thanks for suggestion. If you are interested, you are welcomed to make a pull request so that this problem can get fixed earlier. Thanks!

  11. changed the title [-][Bug] 雷达图空值当成了0来处理[/-] [+][Bug] null value for radar series[/+] on Mar 13, 2025
  12. added this to the TBD milestone on Mar 13, 2025
  13. helgasoft commented on Jul 13, 2026

    @helgasoft

    "How to achieve this effect?" - @skczjun

    A Demo on how to handle missing values with a polar chart.
    Image

  14. tianrking commented on Aug 19, 2026

    @tianrking

    I'd like to work on this.

    I plan to reproduce the current behavior on master, trace the radar data/layout/rendering path so missing dimensions are preserved instead of becoming indistinguishable from real zero values, and add both logic-level and browser/visual regressions covering null/missing values, real zeroes, multiple series, symbols, areas, and tooltip data. I will keep the change compatible with existing radar data that contains only numeric values and run the repository's unit, type, lint, DTS, build, and relevant visual checks before opening a PR.

    AI assistance disclosure: I am using OpenAI Codex for code exploration and implementation assistance; I will review, understand, and test the complete change.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions