Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uncaught exception invalid dimensions for plot flot

Tags:

flot

I drew a line chart using flot in the studentchart div using:

$.plot(jQuery("#studentavgchart"), DATA, options);  

Graph will draw outside the div with class oneTwo. If I can remove the style of the div studentchart it shows javascript error. I need to draw the graph inside the parent div ie; in oneTwo

<div class="oneTwo">
    <div class="widget" >
        <div class="header">
            <span>
                <span class="ico gray info2"></span>Total Class No
            </span>
        </div>
        <div class="content">
            <div id="studentchart" style="width:100%;height:300px;"></div>
        </div>
    </div>
</div> 
like image 597
Sanu Saji Avatar asked Dec 12 '12 05:12

Sanu Saji


1 Answers

I see your plot function call is using "studentavgchart" and your div has the id of "studentchart"

I ran into this issue as well and found that my Plot div needed a style or a class that specified the height. Either in pixels or %.

Hope that helps.

like image 116
Ethan Avatar answered Oct 19 '22 17:10

Ethan