question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Legend text is not correctly aligned with icon (solution)

See original GitHub issue

I noticed that the text align in the legend is not correct. It happens with every symbol type. See screenshots below.

wrong-circle

wrong-square

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:

correct-circle

correct-square


Greetings from an international user!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pissangcommented, Apr 13, 2016

It seems helpful. Considering adding it in the next release

0reactions
Raphyyycommented, Jan 24, 2022

image

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

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found