Chart is not rendered if container is invisible #454

Closed
dnschnur opened this Issue Sep 28, 2012 · 1 comment

Comments

Projects
None yet
1 participant
@dnschnur
Owner

dnschnur commented Sep 28, 2012

Original author: Konstant...@gmail.com (July 10, 2010 19:03:13)

I've tried to show 3 charts in tabs (jQuery tab), but only the chart on first(visible) tab is rendered. container divs are empty in other tabs.
If update the code to show the other tab at startup it is also rendered ok but 2 others are blank.
I had to handle tabs show event to render charts, guess in is not how flot is intended to be used...

Original issue: http://code.google.com/p/flot/issues/detail?id=375

@dnschnur

This comment has been minimized.

Show comment Hide comment
@dnschnur

dnschnur Sep 28, 2012

Owner

From olau%iol...@gtempaccount.com on December 14, 2010 18:11:16
It's a bit complicated but the main problem is that Flot can't measure label sizes because they all come out as 0. Until we switch to drawing labels with the canvas (this may land soon), this is not easy to fix as far as I know. Sorry. It's mentioned in the README:

"Make sure that the placeholder isn't within something with a display:none CSS property - in that case, Flot has trouble measuring label dimensions which results in garbled looks and might have trouble measuring the placeholder dimensions which is fatal (it'll throw an exception)."

and also in the FAQ. I hope to someday be able to fix this as it's something that many people have trouble with, but for the time being I'm going to close this.

Owner

dnschnur commented Sep 28, 2012

From olau%iol...@gtempaccount.com on December 14, 2010 18:11:16
It's a bit complicated but the main problem is that Flot can't measure label sizes because they all come out as 0. Until we switch to drawing labels with the canvas (this may land soon), this is not easy to fix as far as I know. Sorry. It's mentioned in the README:

"Make sure that the placeholder isn't within something with a display:none CSS property - in that case, Flot has trouble measuring label dimensions which results in garbled looks and might have trouble measuring the placeholder dimensions which is fatal (it'll throw an exception)."

and also in the FAQ. I hope to someday be able to fix this as it's something that many people have trouble with, but for the time being I'm going to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment