Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Line graph with Y axis "category" renders null values incorrectly #16664

Closed
htr3n opened this issue Mar 10, 2022 · 2 comments
Closed

[Bug] Line graph with Y axis "category" renders null values incorrectly #16664

htr3n opened this issue Mar 10, 2022 · 2 comments

Comments

@htr3n
Copy link

htr3n commented Mar 10, 2022

Version

5.3.1

Link to Minimal Reproduction

https://codesandbox.io/s/echarts-category-83rl4d?file=/src/index.js

Steps to Reproduce

  1. Create a simple line chart with the following options
import * as echarts from "echarts";

const chart = echarts.init(document.getElementById("chart"));

const options = {
  animation: false,
  xAxis: {
    type: "category",
    splitLine: { show: true },
    data: ["1:00", "2:00", "3:00", "4:00", "5:00"]
  },
  yAxis: {
    type: "category",
    axisLabel: {
      show: true
    },
    showMinLabel: true,
    showMaxLabel: true,
    data: ["A", "B", "C"]
  },
  series: [
    {
      type: "line",
      data: ["null", "A", undefined, "C", null],
      symbol: "circle",
      showSymbol: true,
      symbolSize: 8,
      lineStyle: {
        opacity: 0
      },
      connectNulls: false
    }
  ]
};
chart.setOption(options);

Current Behavior

The chart is rendered correctly with respect to valid values (e.g. the values that are defined in the Y axis data parameter) and "null" (note that null in double quotes as a string) but incorrectly regarding the native JavaScript null value. For instance, in the included example, the last three values are JavaScript native null has been rendered as legit ones with the dots at the value A.

Expected Behavior

The chart should not render any dots regarding the input data null (without double quotes).

Surprisingly, ECharts renders correctly the value "null" (null inside double quotes as a legit JS string, not the native null value).

Another note, ECharts renders correctly if the input data is the native JS undefined value.

Environment

- OS: N/A
- Browser: N/A
- Framework: N/A

Any additional comments?

No response

@htr3n htr3n added the bug label Mar 10, 2022
@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. waiting-for: community labels Mar 10, 2022
@WindyZ99
Copy link
Contributor

I'm interested in fixing it.

@htr3n
Copy link
Author

htr3n commented Mar 15, 2022

@pissang Is this bugfix included in any release or just the nightly builds? Thanks.

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

No branches or pull requests

3 participants