echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Bug] series endLabel failed if no point on chart

Open francois-achache opened this issue 2 years ago • 5 comments

Version

5.4.1

Link to Minimal Reproduction

https://codesandbox.io/s/cdy362?file=/index.js

Steps to Reproduce

Create echart without option option = { xAxis: { type: 'time', }, yAxis: { type: 'value' }, series: [ { data: [ [new Date('1973-11-25:00:00'), null], [new Date('1973-11-25:01:00'), null], [new Date('1973-11-25:02:00'), null], [new Date('1973-11-25:03:00'), null], [new Date('1973-11-25:04:00'), null], [new Date('1973-11-25:05:00'), null], [new Date('1973-11-25:06:00'), 5]], type: 'line', endLabel: {show: true} } ] }; Works... option = { xAxis: { type: 'time', }, yAxis: { type: 'value' }, series: [ { data: [ [new Date('1973-11-25:00:00'), null], [new Date('1973-11-25:01:00'), null], [new Date('1973-11-25:02:00'), null], [new Date('1973-11-25:03:00'), null], [new Date('1973-11-25:04:00'), null], [new Date('1973-11-25:05:00'), null], [new Date('1973-11-25:06:00'), null]], type: 'line', endLabel: {show: true} } ] }; Fail... failed to run code TypeError: uc(...).setLabelText is not a function at e._endLabelOnDuring (echarts.min.js:45:347602) at RS.l (echarts.min.js:45:339639) at RS (echarts.min.js:45:339942) at e.render (echarts.min.js:45:342029) at t.progress (echarts.min.js:45:166701) at t._doProgress (echarts.min.js:45:135208) at t.perform (echarts.min.js:45:134780) at echarts.min.js:45:215513 at e. (echarts.min.js:45:116265) at Array.forEach ()

Current Behavior

if no only value === null in area/chart failed to run code TypeError: uc(...).setLabelText is not a function at e._endLabelOnDuring (echarts.min.js:45:347602) at RS.l (echarts.min.js:45:339639) at RS (echarts.min.js:45:339942) at e.render (echarts.min.js:45:342029) at t.progress (echarts.min.js:45:166701) at t._doProgress (echarts.min.js:45:135208) at t.perform (echarts.min.js:45:134780) at echarts.min.js:45:215513 at e. (echarts.min.js:45:116265) at Array.forEach ()

Expected Behavior

no error

Environment

- OS: Windows 11
- Browser: Edge
- Framework: angular

Any additional comments?

No response

francois-achache avatar Jun 11 '23 09:06 francois-achache

maybe it will work with some decent dates...

helgasoft avatar Jun 11 '23 17:06 helgasoft

no, just change the last value 5 or null and that's work or not No choice I have to disabled this feature in my graph

francois-achache avatar Jun 12 '23 02:06 francois-achache

endLabel displays the last value. If all values are null, then there is no label. Demo Code

helgasoft avatar Jun 12 '23 22:06 helgasoft

yes for sure, but doesnt have to raise an error in jsconsole

francois-achache avatar Jun 16 '23 19:06 francois-achache

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

github-actions[bot] avatar Jun 15 '25 21:06 github-actions[bot]

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!

github-actions[bot] avatar Jun 23 '25 21:06 github-actions[bot]