apache / apache/echarts

calendar的range设置小于1000,会导致同一个实例的setOption方法无法执行。

Open
#15,037 8 comments 0 reactions 0 assignees View on GitHub
bug difficulty: easy topic: calendar waiting-for: community
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
15h 17m
Merged PRs (30d)
5

Description

### Version
5.1.1

### Reproduction link
[https://echarts.apache.org/examples/zh/editor.html?c=calendar-heatmap](https://echarts.apache.org/examples/zh/editor.html?c=calendar-heatmap)

### Steps to reproduce
1. 将案例中的calendar的range设置为"999",这时console会报一个错误:TypeError: Cannot read property 'slice' of undefined。
2. 如果只是不支持时间小于1000也是能理解,但是这时候继续调用setOption会报错: Uncaught Error: `setOption` should not be called during main process.。
3. 猜测是第一步的错误导致setOption中变量IN_MAIN_PROCESS_KEY的状态没有正确更新,导致后续无法再次调用setOption。

### What is expected?
希望canlendar部分代码报错不要影响setOption的正常使用。

### What is actually happening?
canlendar部分代码报错导致setOption无法再次调用。

---
如果每次都销毁实例,然后再调用setOption,是可以正常使用的。

Contributor guide

Open the contributing guide

Research direction

Open the linked calendar-heatmap reproduction and set the calendar range to "999". Trace the calendar error producing the undefined slice result and then call setOption again; done means the calendar failure does not leave setOption reporting that it is still in the main process.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.