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 symbol/label are misaligned in some cases

See original GitHub issue

Version

5.0.1

Steps to reproduce

  1. Create any chart with a legend
  2. Use the legend options below

Note: The use of “Hind” for fontFamily is important here

{
  ...
  icon: 'circle',
  itemWidth: 8,
  itemHeight: 8,
  textStyle: {
    fontFamily: 'Hind',
    fontSize: 12
  }
  ...
}

What is expected?

It is expected that the symbol (circle) and the label are vertically-aligned with each other.

What is actually happening?

When using “Hind” as the font family, the symbol and label are not vertically-aligned with one another. Other fonts (including custom fonts) do not have this issue. I tried modifying nearly all related options, including trying to “hack” together something that forced the label and symbol to align but nothing worked.

v4 of eCharts worked fine for the “Hind” font so it’s something to do with v5.


After upgrading to v5, the legend symbol/labels were no longer aligned. We had been using v4 for 2-3 years with no problem.

Screenshots

Notice how the symbol (circle) and the label are not vertically-aligned with one another (“Hind” font)

Screenshot 2021-01-26 at 06 21 43

Notice when using other fonts (Montserrat and default font, respectively), the symbol and labels are perfectly aligned

Screenshot 2021-01-26 at 06 23 35

Screenshot 2021-01-26 at 06 24 54

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
gregdeanecommented, Mar 19, 2021

Hello, just following up on this. It’s labeled as “not-a-bug” but @Ovilia’s suggestion does not work. If there is no solution to the issue, then I believe this is a bug.

Can someone please reply with a way to address the issue in the initial comment?

0reactions
gregdeanecommented, Feb 24, 2021

@Ovilia Any thoughts or suggestions on my comment above?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamic Legend - alignment issues - Esri Community
I have been trying to create a dynamic legend for my maps but I am having some major issues with the alignment of...
Read more >
Legend symbol and text alignment is incorrect #1198 - GitHub
I want to generate a legend where the symbol alignment is set correctly to the respective text. Actual behaviour. The height of the...
Read more >
in highcharts, how can I align legend symbol and legend text?
As you can see in the jsfiddle example, the legend symbol is not aligned with the legend text. Is there a way to...
Read more >
Why is the text in the legend not aligned properly to its ...
The legend that is created is misaligned. The text does not align vertically with the plot figures in the legend. It is a...
Read more >
Spine Misalignment Symptoms, Risk Factors, and Treatments
Minor issues with spine alignment may not necessarily be a cause for ... In some cases, severe misalignment may require medical treatment.
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