Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setTitle on hidden chart -> titles overlap (when useHTML) #2267

Closed
iweindesmedt opened this issue Sep 18, 2013 · 6 comments
Closed

setTitle on hidden chart -> titles overlap (when useHTML) #2267

iweindesmedt opened this issue Sep 18, 2013 · 6 comments
Labels
Priority: Normal Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur. Type: Bug

Comments

@iweindesmedt
Copy link

http://jsfiddle.net/W4EEg/13/

only applies when useHTML is on

@TorsteinHonsi
Copy link
Collaborator

It only happens when the chart is hidden (by giving the container display: none) at the time you are running setTitle. This is because Highcharts is unable to compute the measured height of the text, as the offsetHeight of a non-displayed element and its children is 0.

Two workarounds are possible:

@iweindesmedt
Copy link
Author

Thanks for the workarounds. It indeed works that way.
Maybe you could introduce it in other operations related to useHTML as well?
I think axis labels and legend labels for example may also be affected.

@iweindesmedt
Copy link
Author

I figured that cloneRenderTo() throws an error NotFoundError: Node was not found when the chart container is hidden. Any workaround for that?

@oysteinmoseng
Copy link
Member

This is still relevant. One way to solve it could be to check for display: none on container, and move the container offscreen for rendering, before changing it back to display: none.

@TorsteinHonsi
Copy link
Collaborator

Updated workaround:

Use the thorougher chart.update intead of the cheaper chart.setTitle: http://jsfiddle.net/W4EEg/35/

@stale
Copy link

stale bot commented Nov 13, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions!

@stale stale bot added the Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur. label Nov 13, 2019
@stale stale bot closed this as completed Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Normal Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur. Type: Bug
Projects
None yet
Development

No branches or pull requests

3 participants