autukill commented on issue #12318: Tooltip 使用 richText 模式后, 
Tooltip的边框宽度和边框颜色失效了
URL: 
https://github.com/apache/incubator-echarts/issues/12318#issuecomment-604193224
 
 
   @Ovilia 
   查看tooltip的源码后,发现边框的颜色和宽度没有实现, 但查看 zrender 的文档后,发现实现这个功能还是很容易实现的:
   
   https://ecomfe.github.io/zrender-doc/public/api.html#zrenderdisplayable
   - opts.style.textBackgroundColor 文字包围盒颜色。
   - opts.style.textBorderColor 文字包围盒描边颜色。
   
   修改源码 lib/component/tooltip/TooltipRichContent.js 第126行为以下
   ``` javascript
   this.el = new Text({
         style: {
           rich: markers,
           text: content,
           textLineHeight: 20,
           textBackgroundColor: tooltipModel.get('backgroundColor'),
           textBorderRadius: tooltipModel.get('borderRadius'),
           textFill: tooltipModel.get('textStyle.color'),
           textPadding: tooltipModel.get('padding'),
           textBorderWidth: tooltipModel.get('borderWidth'),
           textBorderColor: tooltipModel.get('borderColor')
         },
         z: tooltipModel.get('z')
   });
   ``` 
   修改新增了下面两行
   - textBorderWidth: tooltipModel.get('borderWidth'),
   - textBorderColor: tooltipModel.get('borderColor')
   
   tooltip 的富文本还有一些可配置的没有给出来, 比如 textLineHeight 行高被写死为 20.
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org

Reply via email to