Legend text is not correctly aligned with icon (solution)
See original GitHub issueI noticed that the text align in the legend is not correct. It happens with every symbol type. See screenshots below.
This happens both on your website (http://echarts.baidu.com/demo.html#area-stack) as well as on my website.
I’ve updated line 41766
in echarts.js (3.1.6, not minimized) to:
y: (itemHeight / 2) - 6
(I’ve added the - 6
as a correction).
Now, they’re perfectly aligned:
Greetings from an international user!
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Alignment of text and the icon in the legend box (matplotlib)
I am experiencing the same issue in Python 2.7 and 3.3, Ubuntu 15.04, matplotlib 1.4.2, and using the Agg backend.
Read more >Why is the legend symbol alignment in Print Composer worse ...
First, make sure your map is locked in the print composer (so that you don't create overplotting issues in the image). Then go...
Read more >The Field Set Legend element - HTML - MDN Web Docs
The <legend> HTML element represents a caption for the content of its parent <fieldset> . ... Implicit ARIA role, No corresponding role.
Read more >Align pictures, shapes, WordArt and other objects in Word
You can have Word align objects—such as pictures, shapes, SmartArt, and charts—in relation to the edges of the page, the margins, or other...
Read more >How to Align <legend> Tag Text to Center ? - GeeksforGeeks
The bottom alignment are not supported by any browsers. We can use CSS to align <legend> tag element to center. The CSS margin-left...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It seems helpful. Considering adding it in the next release
I can’t find a way to correctly align the legend text with Roboto font (Echarts 5.2.2 used) Setting
legend.textStyle.lineHeight
doesn’t change a thing