* @param {Object} textStyle * @return {string} * @inner
(textStyleModel: Model<TooltipOption['textStyle']>)
| 148 | * @inner |
| 149 | */ |
| 150 | function assembleFont(textStyleModel: Model<TooltipOption['textStyle']>): string { |
| 151 | const cssText = []; |
| 152 | |
| 153 | const fontSize = textStyleModel.get('fontSize'); |
| 154 | const color = textStyleModel.getTextColor(); |
| 155 | |
| 156 | color && cssText.push('color:' + color); |
| 157 | |
| 158 | cssText.push('font:' + textStyleModel.getFont()); |
| 159 | |
| 160 | // @ts-ignore, leave it to the tooltip refactor. |
| 161 | const lineHeight = retrieve2(textStyleModel.get('lineHeight'), Math.round(fontSize * 3 / 2)); |
| 162 | |
| 163 | fontSize |
| 164 | && cssText.push('line-height:' + lineHeight + 'px'); |
| 165 | |
| 166 | const shadowColor = textStyleModel.get('textShadowColor'); |
| 167 | const shadowBlur = textStyleModel.get('textShadowBlur') || 0; |
| 168 | const shadowOffsetX = textStyleModel.get('textShadowOffsetX') || 0; |
| 169 | const shadowOffsetY = textStyleModel.get('textShadowOffsetY') || 0; |
| 170 | shadowColor && shadowBlur |
| 171 | && cssText.push('text-shadow:' + shadowOffsetX + 'px ' + shadowOffsetY + 'px ' |
| 172 | + shadowBlur + 'px ' + shadowColor); |
| 173 | |
| 174 | each(['decoration', 'align'] as const, function (name) { |
| 175 | const val = textStyleModel.get(name); |
| 176 | val && cssText.push('text-' + name + ':' + val); |
| 177 | }); |
| 178 | |
| 179 | return cssText.join(';'); |
| 180 | } |
| 181 | |
| 182 | function assembleCssText( |
| 183 | tooltipModel: Model<TooltipOption>, |
no test coverage detected
searching dependent graphs…