baidu / baidu/amis

chart组件,在formatter中使用上下文变量时,有时可以获取到值,有时获取不到?加载顺序是否有问题?

Open
#8,752 5 comments 0 reactions 0 assignees View on GitHub
need confirm
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

#### 描述问题:
jssdk版本:v3.4.2
1、使用chart组件,做个饼图在饼图的图例上展示数值,在formatter中使用config.series[0].data(这个数据是接口获取的)数据时,有时获取不到数据,有时可以获取到,偶现,请问是否和加载顺序有关,应该怎么解决这个问题呢?
想加个setTimeout但是好像不行...

希望看到能回复一下~ 谢谢
#### 截图或视频:
image
image

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the chart component's pie-chart legend formatter and reproduce the intermittent behavior using API-loaded values from config.series[0].data. Trace when the formatter runs relative to data loading; done means the formatter consistently receives the expected values without relying on setTimeout.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.