You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "asifliton (via GitHub)" <gi...@apache.org> on 2025/02/25 09:35:07 UTC

[I] [Bug] Tooltip lineHeight resets the layouts padding [echarts]

asifliton opened a new issue, #20790:
URL: https://github.com/apache/echarts/issues/20790

   ### Version
   
   5.6.0
   
   ### Link to Minimal Reproduction
   
   https://echarts.apache.org/examples/en/editor.html?c=line-polar&code=MYewdgzgLgBAJgQygmBeGBtAugbgFABmIATjABQA2AprAJZowAMOM9APOgIyPOsDUfAJQwA3nhgxqsKAAsaKdGXoB6GN0bCAVDADMANmbjJNGKXQBWGNrKcYfGAFkkMgHQRaYMmVnyYqzgAcGlaOzi4ACgCSgoL4EojILgAOAK4QMmQYxAA0MD7IWLF4AL54IElQtOAMYhKVUNQAXKJGdVQAHlDNAOQAKgDuIDAAaggUKVQAtACC7VQQrGAw4SAUCMTdRsXZRtQA5lRgcM21EvBICM0Y3RQeVN1YWzsSSavrJ9tGUCCrlUknrTyxFoewOxB6CHatAg3WeZwARiQ4FRiAB1WhwWQ9ThJdqwwGI4jI4gAYVWJB6AGIeIx8WcYJDoSsPFAUQD6XUAJ5JKg9YDEEAQGFwiSfemszoAZSgnKaLQ5kjuAAkqCCZF01C4AEyA0qiuEIMB7aizaHss4ynk9ABuYwmdLO0HWUGmRrljCeRmICDgtDSpogHzhEBRtHmV0Bp3poCRHiQVElnOgVAAtj1XmsNiKzmAECneTAbncHeLuQWi2B7tn4hdmgkELqjI9ijggA
   
   ### Steps to Reproduce
   
   1. Create a chart of any kind. (Tested: line and polar)
   2. Add a tooltip.textStyle.lineHeight property. (Tested: 0.5 - 2)
   
   ### Current Behavior
   
   Notice the tooltip layout default padding has been reset.
   <img width="1407" alt="Image" src="https://github.com/user-attachments/assets/c72586ba-3266-46d5-b877-0c2052398a6d" />
   
   ### Expected Behavior
   
   Default padding should not have any impact on lineHeight set or change.
   
   ### Environment
   
   ```markdown
   - OS: macOS 15.3.1 (24D70)
   - Browser: Google Chrome 133.0.6943.127 (Official Build) (arm64)
   - Framework: N/A
   ```
   
   ### Any additional comments?
   
   _No response_


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [I] [Bug] Tooltip lineHeight resets the layouts padding [echarts]

Posted by "sz-p (via GitHub)" <gi...@apache.org>.
sz-p commented on issue #20790:
URL: https://github.com/apache/echarts/issues/20790#issuecomment-2681757982

   The `TooltipMarker` default size is 10, and it can't be set by option. 
   Set `lineHeight` to be greater than 10. it will be right.
   
   The question is should we reset `TooltipMarker` size by `lineHeight`?
   


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [I] [Bug] Tooltip lineHeight resets the layouts padding [echarts]

Posted by "asifliton (via GitHub)" <gi...@apache.org>.
asifliton commented on issue #20790:
URL: https://github.com/apache/echarts/issues/20790#issuecomment-2681783009

   Hello @sz-p, I am confused about the naming.  Could you confirm if you denoted the marked area as a `TooltipMarker`?
   NB: I have also updated the bug description image.
   
   <img width="1407" alt="Image" src="https://github.com/user-attachments/assets/39cc0026-3dd7-4404-b90d-32b8bf8ed70c" />


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [I] [Bug] Tooltip lineHeight resets the layouts padding [echarts]

Posted by "sz-p (via GitHub)" <gi...@apache.org>.
sz-p commented on issue #20790:
URL: https://github.com/apache/echarts/issues/20790#issuecomment-2682309183

   `TooltipMarker` is the blue circle.
   
   ![Image](https://github.com/user-attachments/assets/48c6087b-9a2d-4ef1-bdb8-835c45319d7f)
   
   For now `lineHeight` should to be greater than 10.
   


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [I] [Bug] Tooltip lineHeight resets the layouts padding [echarts]

Posted by "asifliton (via GitHub)" <gi...@apache.org>.
asifliton commented on issue #20790:
URL: https://github.com/apache/echarts/issues/20790#issuecomment-2683782152

   Thank you @sz-p , `tooltip.textStyle.lineHeight: 10` works for now. However, I have also noticed the `lineHeight` property could be ditched if not needed. Instead defining `tooltip.textStyle.fontSize` property works for now as well. 
   Moreover, looking forward to a proper fix.  Sharing some probable workaround to the problem below:
   
   ### Workaround:
   ```js
   option = {
     xAxis: {
       type: 'category',
       data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
     },
     yAxis: {
       type: 'value'
     },
     series: [
       {
         data: [150, 230, 224, 218, 135, 147, 260],
         type: 'line'
       }
     ],
     // Extended config from the example
     tooltip: {
       trigger: 'axis',
       textStyle: {
         // ✘ Do not use the `lineHeight` property as it resets the padding.
         // lineHeight: 1, 
         /**
          * ✔ workaround (1): If the `lineHeight` is needed use a greater value.
          * As `lineHeight: 10` is used instead of 1. Feel free to tweak the value
          * to suffice your need.
          */
         // lineHeight: 10,
         /**
          * ✔ workaround (2): If the `lineHeight` property could be avoided use
          * a `fontSize` property. As semantic conventions still follows here.
          */
         fontSize: 12,
       }
     }
   };
   ```
   
   **Ref: ** [Echart tooltip line height issue workaround.](https://echarts.apache.org/examples/en/editor.html?c=line-simple&code=PYBwLglsB2AEC8sDeAoWsAeBBDEDOAXMmurGAJ4gCmRA5AMYCGYVA5sAE7m0A0J6AE2aMiAbVoBZGL1i0AKgFcqM2gHUqAlXIAWClQDEOEFQGVmphdFoBdEgF8-6cjnxFUpMpRqyAbowA2SrT2jrB4VEZUhLCi_MQegsJiAIwArAAMPLAATADMmTnZACxZ2ckAHFnJualVRQDspQBs6dahHhTUdP4Q0MpxdiRtJAD0I7AAohgs0AIasPQwAGYQrLBLHMAAtmTaVLBUGIxbIP5UJGDAwP6QIG5xYEasrBF0jLh4vA-HYCYUZ_cErAxrBABjksAAIsBYNBgGBYApwrt9gADHp9AASVFW2jAKNgIE21A4FFgjDwsAg8I4USoYApYD2BMYAgEvVYADo4ugQeiqFicWAiMkstzgQAqcVi2Di2CAFHJYAB3TgAa0Ym0sAlgAApkgBKIgASSWyNgaN6_OxrFx-PwMKoGnmiP2jFgrBpzAisD8gSoXKBMtgWAp5sxVtxwvStopzq1vTwLBZsGAJuSHNg-gd_nWNP2lzIiqojBVpp9SmlsvzeAUSxW9H25GACg49o0_qB4pGYt5FoF1qFsGSmW7kor8qVqvVTdmOuyBtgxtNoctgvxhNAEVJiwU_i1ACMXT5gBA5lrnWPXSiljBfhAAF5UNdEzfkdPBsJULaMaCQegLGA-FQP5QNAFIJhA_jZtekHAIqFJ7DS7YJJ2YrXj-Jj3t4yTZO0sCDOggx2AA3EAA)
   
   **Image:**
   ![Image](https://github.com/user-attachments/assets/c2540855-4466-4431-b42a-c301f08604b7)
   
   
   
   
   
   


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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