apache / apache/echarts

[Feature] series-bar.markLine.label.formatter 可以返回配置项或配置项都支持函数

Open
#21,399 1 comment 0 reactions 0 assignees View on GitHub
new-feature pending
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### What problem does this feature solve?

```
markLine: {
symbol: ['none', 'none'],
label: {
show: true,
formatter(params) {
return params.data.value
},
position: 'middle',
distance: (params) => params.data.space/ 2,
}
}
```
比如我期望 distance 可以是动态计算的,像上例一样:`distance: (params) => params.data.space/ 2`,但目前 distance 并不支持函数,要是所有配置项都支持函数,那么编程能力将大大增强。

或者`formatter`已经支持了函数,`formatter` 的返回值可以改成这样:
```
{
distance: xxx,
position: yyy,
...
}
```
distance 、position 等就是外层的配置,同样可以增强编程能力。

现在方便是方便,就是不够灵活。

### What does the proposed API look like?

-

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.