5

Everytime i refresh my page, i get this error in the console

Uncaught Error: Invalid dimensions for plot, width = 335, height = 0

The pie chart loads the first time, but on refresh, it throws this error and does not appear.

Any suggestions /solutions ?

Thanks

user3778507
  • 51
  • 1
  • 3
  • 5
    The container you use for the chart must have both width and height. Looks like those are not set after a refresh. Show us some code, if you need more help. – TPete Jun 30 '14 at 07:07
  • possible duplicate of [Flot pie chart gives error in firebug: "uncaught exception: Invalid dimensions for plot, width = null, height = null"](http://stackoverflow.com/questions/12366549/flot-pie-chart-gives-error-in-firebug-uncaught-exception-invalid-dimensions-f) – DNS Jul 04 '14 at 15:10

1 Answers1

2

You probably forgot to specify the height for the div holder of the graph.

<div id="myGraph" style="height:500px;"></div>

This will probably solve your issue. :)

Rohan
  • 13,308
  • 21
  • 81
  • 154
  • or if the graph height is set to 100% then that parent container must have a height set in pixels – nuander Jul 05 '17 at 23:56