Visitar URL original
fix(candlestick/boxplot): accept null and undefined data items. · apache/echarts@8c384ea · GitHub
Skip to content

Commit 8c384ea

Browse files
fix(candlestick/boxplot): accept null and undefined data items.
1 parent 84b69e4 commit 8c384ea

2 files changed

Lines changed: 88 additions & 1 deletion

File tree

‎src/chart/helper/whiskerBoxCommon.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ export class WhiskerBoxCommonMixin<Opts extends CommonOption> {
130130
// Modify current using data.
131131
item.unshift(index);
132132
}
133-
else if (zrUtil.isArray(item.value)) {
133+
// `item` may be an empty value (`null`/`undefined`, which are documented
134+
// as equivalent to `'-'`), so it must not be dereferenced directly.
135+
else if (item != null && zrUtil.isArray(item.value)) {
134136
newItem = zrUtil.extend({}, item);
135137
newItem.value = newItem.value.slice();
136138
// Modify current using data.

‎test/ut/spec/series/whiskerBoxEmptyValue.test.ts‎

Lines changed: 85 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)