apache / apache/echarts

transform function that returns empty dataset causes issues with endLabel Formatter

Open
#15,719 1 comment 0 reactions 0 assignees View on GitHub
bug en
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### Version
5.2.0

### Reproduction link
[https://jsfiddle.net/x1hmnfwu/24/](https://jsfiddle.net/x1hmnfwu/24/)

### Steps to reproduce
Create a line series with an endLabel that has a formatter specified.
Point this series at a dataset that uses a transform function that can return no data points. (Imagine a filter that filters everything out, or a trend function that doesn't have enough data yet to return anything meaningful) is used for that series.
A per the jsfiddle, the line will not render (nor will any downstream rendering operations).

### What is expected?
The line should not appear, the endlabel should not render, an error shouldn't occur.

### What is actually happening?
echarts.min.js:45 Uncaught TypeError: Cannot read properties of undefined (reading 'length')

---
I'm using a transform that results in an 'empty' dataset. This feels like something that could occur and needs to be supported. I've tried various workarounds such as an array with a null, an array with an object in it with value dimensions, but null values. Nothing appears to work :(

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.