[英]Why would the div with this flot chart not resize correctly when changing using $route (AngularJS)
如果我從主屏幕上單擊,然后返回,則該圖的大小無法正確調整。
HTML很簡單(某些樣式用於調試/測試):
<div class="panel-body" ng-show="graphType !== 'Mood Sentiment'" style="width:100%; max-width:100%;">
<flot id="placeholder" dataset="dataset" options="options" height="300px" style="width:100%; max-width:100%;"
ng-disabled="graphLoading" ng-class="{disabled:graphLoading} "></flot>
</div>
它在做什么:
我想要它在做什么:
我還沒有使用過flot,但是通過搜索來尋找與angular相關的flot大小問題,其中一項評論表明,flot-resize插件使用angular來解決了他們的問題。
我建議嘗試將flt resize js包含在您的應用中,看看是否可以解決。
<script src="../../jquery.flot.js"></script>
<script src="../../jquery.flot.resize.js"></script>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.