通过JSON配置ECharts时,函数如何传入外部参数
- Dominant language
- TypeScript
- Stars
- 18.9k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
#### 实现场景:
ECharts中的数据显示格式需要根据API获取的值类型显示。
#### 存在的问题:
无法将API获取的值传入到formatter的function中
#### 当前方案:
无
```
{
"type": "page",
"body": {
"type": "chart",
"api": "/api/....",
"config": {
"legend": {
"formatter": "function (name) { return 'Legend ' + name;}"
},
"yAxis": {},
"series": [
{
"type": "bar",
"seriesLayoutBy": "row"
}
]
}
}
}
```

Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing how the chart's JSON config and API data are handled, focusing on the ECharts formatter example in the issue. Determine whether the requested external API value can be made available to formatter functions, and consider the work complete when the documented configuration supports that value and the formatter behavior is verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data-visualization, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100