apache / apache/echarts

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

未关闭
#17,543 5 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
67.3k
派生
19.8k
平均合并
15 小时 17 分钟
30 天内合并 PR
5

描述

### 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`

贡献指南

打开贡献指南

调研方向

首先跟踪 tooltip's renderMode:'richText' 路径如何在 WeChat mini-program/no-DOM 渲染器中使用 formatter 的输出。验证所选的 tooltip.rich 或 tooltip.textStyle.rich API 是否将命名样式应用于 {name|...} 和 {value|...} 输出,并确认示例会渲染出不同的颜色。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, typescript
领域
data-visualization
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。