I have this error when I insert charts in hidden tabs like second, third, etc. here is the error:
Invalid dimensions for plot, width = 0, height = 400 in js/jquery.flot.min.js:6.
I used bootstrap 2 and jquery:
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
Here are the libraries:
<script src="js/jquery.flot.min.js"></script>
<script src="js/jquery.flot.pie.min.js"></script>
<script src="js/jquery.flot.stack.js"></script>
<script src="js/jquery.flot.resize.min.js"></script>
And the css:
#plotarea
{
max-width: none;
height: 400px;
}
#pie
{
max-width: none;
height: 400px;
}
#barmonth
{
max-width: none;
height: 400px;
}
#baryear
{
max-width: none;
height: 400px;
}
The div with the id of every chart(always change the id to the chart I need to show, like plotarea, pie, barmonth, baryear, etc):
<div id="plotarea"></div>
And I add this style to fix the width error .ui-tabs .ui-tabs-hide { left: -10000px; visibility: hidden !important; }
, but even this the chart doesn't draw the charts inside of those hidden tabs only draw the first tab which is in the first view...can you now if there is a form to fix it?
I use the charisma template.
Best regards!
max-width: none;
no matter which size of screen do you have always you will see the chart the in all the screen – Persnicketymax-width: none;
, but when is in the second tab, third and so on doesn't draw it...that is because the tab is not created like the first one so the jqflot don't know the width...when I insert or change themax-width to width = 600px;
jqflot draw it, but the chart don't redraw the charts if per example you turn your device in portrait or landscape mode in your tablet of phone... – Persnicketyreplot
function of jqplot. – Ningpostyle="width:100%"
to the outer table (containing the graph) otherwise it was taking the width=0 – Ascribe