[Bug] Tooltip textStyle lineHeight property assignment does not persist
Version
5.2.2
Link to Minimal Reproduction
https://codesandbox.io/p/sandbox/ntt82g
Steps to Reproduce
- When changing the line height value in the index.js in the tooltip
- Open the popup in a new window to be able to use the developer tools.
- Go to the sources tab in the developer tools
- Use mouse to hover over bar chart to get a tooltip to show up
- After the tooltip is present press the F8 key to pause the page
- In the developer tools go to the Elements tab and find or select the tooltip HTML element
- In examining the style attribute of the tooltip HTML element, you will see the '... font: italic bold 40px / 60px Papyrus; ...'
- The 60px in this example is the line height. The lineHeight value only changes when updating the fontSize property.
Current Behavior
no matter what the tooltip -> textStyle -> lineHeight property is set to, the resulting HTML element's style attribute, will be one and one half times the value of the tooltip -> textStyle -> fontSize property value.
Expected Behavior
When specifying the tooltip -> textStyle -> lineHeight that the property is properly rendered in the resulting HTML element. tooltip: { textStyle: { // Does not work lineHeight: 40, // Does work fontFamily: "Papyrus", fontStyle: "Italic", fontSize: 40, textBorderColor: "yellow", backgroundColor: "orange", fontWeight: "bold", color: "red", }, },
The above tooltip configuration should have the following resulting style in the HTML element:
Environment
- OS: Windows 11
- Browser: Brave Version 1.70.123 Chromium: 129.0.6668.89 (Official Build)
- Framework: Typescript Version 5.3.3
Any additional comments?
No response
That would be great! Thank you!
On Tue, Oct 8, 2024 at 5:29 AM sz-p @.***> wrote:
Look like a bug. should i support line-height in getTooltipTextStyle https://github.com/apache/echarts/blob/master/src/component/tooltip/tooltipMarkup.ts#L46 ?
— Reply to this email directly, view it on GitHub https://github.com/apache/echarts/issues/20391#issuecomment-2399470077, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTWJDUDEZIH4L557QAIQILZ2OXZNAVCNFSM6AAAAABPMXMVY6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJZGQ3TAMBXG4 . You are receiving this because you authored the thread.Message ID: @.***>