[Feature] Hope "tooltip" supports "rich". 希望“tooltip”支持“rich”
- 主要語言
- 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