atom feed10 messages in com.googlegroups.flot-graphsuncaught exception: Invalid dimension...
FromSent OnAttachments
Ruben OliveiraMar 29, 2011 3:05 am 
George RobertsMar 29, 2011 7:29 am 
Ruben OliveiraMar 29, 2011 8:15 am 
George RobertsMar 29, 2011 8:35 am 
Ole LaursenApr 4, 2011 4:24 am 
Ruben OliveiraApr 4, 2011 10:04 am 
Ruben OliveiraApr 4, 2011 10:24 am 
Ruben OliveiraApr 5, 2011 1:30 am 
George RobertsApr 5, 2011 6:01 am 
Ruben OliveiraNov 22, 2011 7:26 am 
Subject:uncaught exception: Invalid dimensions for plot, width = 0, height = 0
From:Ruben Oliveira (
Date:Mar 29, 2011 3:05:25 am


I'm using flot in a relatively large project, where I am showing a chart with a large number of points. When I say large I'm refering to series with up to 50.000 points, and let me congratulate the flot development team because the performance is quite good!

However, I'm facing the following problem: Some times, I get this message in firebug:

«uncaught exception: Invalid dimensions for plot, width = 0, height = 0»

Although the message is clear, the fact is that I protected my code as much as possible to make sure that every time the plot method is called, the container dimensions are specified. I have this for granted, and whenever the problem happens, I check the dom (with firebug) and the dimensions are specified on the container. I even make sure, through the use of dom ready event, that the plot is called only when container is available.

A couple of days ago, I searched for the problem on the flot code and I ended up suspecting that the problem might be related to some sort of cache related with jquery. I'm not very experienced in jquery, the project I'm working on uses YUI, so I'm not quite sure about this.

Does anyone have a clue about the cause of this behavour?

The construction of the chart is made within a class that does this: 1st: creates the page layout, including the chart placeholder 2nd: appends the layout on the DOM 3rd: adjusts the layout to the page body (in this process, dimensions are specified for the chart placeholder) 4th: checks if the placeholder has its dimensions specified, and if it doesn't specify it 5th: creates the chart only when the placeholder is available (using the YAHOO.util.Event.onAvailable)

As you can see, the process is a bit redundant to make sure dimensions are set for the placeholder.