Uncaught Invalid dimensions for plot, width = null, height = null for flot charts api

后端 未结 3 2211
长发绾君心
长发绾君心 2021-01-23 02:37

I am using flot charts API for showing the graphs and I am successful in plotting the data. I am loading around 30 charts in one page and I am rendering them in ui-tabs.All the

3条回答
  •  孤街浪徒
    2021-01-23 02:54

    I had the same issue. A different solution worked for me.

    • Make sure you set the height and width the style="width:100%;height:400px" (check out Invalid dimensions for plot, width = 0, height = 400 inside of hidden tab)
    • Make sure flot is not looking for some div which DOES NOT exist. This was the case since I copied it from a page which had three plots, whereas I used the first and the third. I could locate it by using chrome's console (It crashed after not finding the second div in the page. Hence the third one was not being plotted. Just comment out the unused plotting in the js and it worked fine)

提交回复
热议问题