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] if candlestick with slider zoom, charts's dataset secend dimension must be "open" #17228

Closed
ragnaroks opened this issue Jun 16, 2022 · 1 comment
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.

Comments

@ragnaroks
Copy link

Version

5.3.3

Link to Minimal Reproduction

https://codesandbox.io/s/optimistic-zhukovsky-j1bbn2?file=/src/index.js

Steps to Reproduce

just open the link then will get 2 error, both are Cannot read properties of undefined (reading '0')

but if change the dataset's open1 to open, and change the dimensions's open1 to open, the slider zoom component will render and no error.

Current Behavior

if secend dimension is not open, the slider zoom component not render and throw errors

Expected Behavior

render zoom component render with any key of secend dimension

Environment

- OS: Windows 10.0.19041
- Browser: Chrome 102.0.5005.115
- Framework: NEXT.js

Any additional comments?

this will throw errors

const dataList = [
  { date: "2017-10-24", open1: 20, close2: 34, low3: 10, high4: 38 },
  { date: "2017-10-25", open1: 40, close2: 35, low3: 30, high4: 50 },
  { date: "2017-10-26", open1: 31, close2: 38, low3: 33, high4: 44 },
  { date: "2017-10-27", open1: 38, close2: 15, low3: 5, high4: 42 }
];

const option = {
  xAxis: [{ type: "category" }],
  yAxis: [{ type: "value" }],
  series: [{ type: "candlestick" }],
  dataset: {
    name: "K Line",
    source: dataList,
    dimensions: ["date", "open1", "close2", "low3", "high4"]
  },
  dataZoom: [{ type: "slider", xAxisIndex: 0, filterMode: "filter" }]
};

but this will render success

const dataList = [
  { date: "2017-10-24", open: 20, close2: 34, low3: 10, high4: 38 },
  { date: "2017-10-25", open: 40, close2: 35, low3: 30, high4: 50 },
  { date: "2017-10-26", open: 31, close2: 38, low3: 33, high4: 44 },
  { date: "2017-10-27", open: 38, close2: 15, low3: 5, high4: 42 }
];

const option = {
  xAxis: [{ type: "category" }],
  yAxis: [{ type: "value" }],
  series: [{ type: "candlestick" }],
  dataset: {
    name: "K Line",
    source: dataList,
    dimensions: ["date", "open", "close2", "low3", "high4"]
  },
  dataZoom: [{ type: "slider", xAxisIndex: 0, filterMode: "filter" }]
};
@ragnaroks ragnaroks added the bug label Jun 16, 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. labels Jun 16, 2022
@jiawulin001
Copy link
Member

It's a problem with sliderZoom component, submitting a PR to solve this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.
Projects
None yet
Development

No branches or pull requests

2 participants