apache / apache/echarts

[Feature] Hope "tooltip" supports "rich". 希望“tooltip”支持“rich”

Open
#17,543 5 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### What problem does this feature solve?

目前`tooltip`不支持`rich`,`renderMode:'richText'`似乎是一个没用的选项,在没有dom的微信小程序里,没办法自定义不同的样式。
Currently, `rich`is not supported by`tooltip`, and`renderMode:'richText'`seems to be a useless option. In wechat applets without DOM, there is no way to customize different styles.
```js
option = {
tooltip: {
renderMode: 'richText',
formatter({ name, value }) {
return `{name|${name}}:{value|${value}}`;
},
// invalid 无效
rich: {
name: { color: 'red' },
value: { color: 'blue' }
},
textStyle: {
// invalid 无效
rich: {
name: { color: 'red' },
value: { color: 'blue' }
}
}
},
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [
{
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar'
}
]
};
```

### What does the proposed API look like?

`tooltip.rich`
or
`tooltip.textStyle.rich`

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.