plainheart edited a comment on pull request #12673:
URL: 
https://github.com/apache/incubator-echarts/pull/12673#issuecomment-634829856


   Hi~ @susiwen8 Thanks for your fixing.
   I've been inspired by following code lines from @Ovilia ~
   Maybe we can make some changes like this
   
https://github.com/apache/incubator-echarts/blob/5a94212c43f0a4b5a8da7c26cf20192d29fb1d02/src/component/tooltip/TooltipRichContent.js#L139-L147
   
   As mentioned above, there may be no need to solve this issue as present 
scheme.
   ```js
   var textRect = textContain.getBoundingRect(text, font, null, null, null, 
labelModel.get('lineHeight'));
   ```
   
   Some changes are as follows
   ```js
   style: graphic.setTextStyle({}, labelModel, {
       text: text,
       fill: bgColor,
       stroke: labelModel.get('borderColor') || 'transparent',
       lineWidth: labelModel.get('borderWidth') || 0,
       textFont: font,
       textPosition: 'inside',
       textPadding: paddings,
       textFill: labelModel.getTextColor()
   })
   ```
   This can solve the issue that `lineHeight` is invalid and in the meanwhile, 
there are more supported properties of label.(Note that some new supported 
properties are now missing description in the official document)
   ```js
   label: {
       fontWeight: 'bold',
       fontSize: 20,
       textShadowBlur: 10,
       textShadowOffsetX: 10,
       textShadowOffsetY: 10,
       textShadowColor: 'red',
       backgroundColor: 'yellow',
       textBorderColor: 'blue',
       textBorderWidth: 5,
       borderWidth: 2,
       borderColor: 'cyan',
       padding: [10, 20, 30, 40],
       shadowColor: 'green',
       shadowBlur: 5,
       shadowOffsetX: 10,
       shadowOffsetY: 10,
       borderRadius: 20,
       lineHeight: 40,
       color: 'purple',
       // width: 400, // rich is needed, but rich is TODO
       // height: 200, // rich is needed, but rich is TODO
   }
   ```
   A test screenshot(Just for test, No beauty)
   
   
![image](https://user-images.githubusercontent.com/26999792/83052334-bec49100-a081-11ea-9ea7-504e578b1b52.png)
   
   Looks good.
   
   In the last, that's a pity rich label is still a TODO. I have no idea about 
it by now, but I think we can refer to implements of 
[TooltipRichContent](https://github.com/apache/incubator-echarts/blob/5a94212c43f0a4b5a8da7c26cf20192d29fb1d02/src/component/tooltip/TooltipRichContent.js#L74-L108)
 
   
   Let we make it right together~ : )
   


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



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

Reply via email to