簡體   English   中英

如何調整實時浮點圖的大小?

[英]How to resize a real time flot chart?

調整瀏覽器大小時,是否有js庫或調整即時浮點圖大小的方法? 我的圖表就是這個例子 該示例與我的圖表之間的區別在於它放在了表格中。

編輯:我發現jquery.flot.resize.js存在,並做我想要的。 但是,是否會影響庫功能表中表的位置?

您可以使用相對單位來調整元素相對於窗口大小的大小,其中之一是%。 以%設置元素的寬度和高度,它將根據父級的%age大小調整此元素的大小。

Resize window to see results!
<div style="
  position: absolute;
  width: 50%;
  height: 50%;
  background: red;">
      Resizeable DIV
</div>

此處給出的演示https://jsfiddle.net/7rtguhuv/

我在這里發布解決方案。 也許有人會需要它。 我使用了jquery.flot.resize.js和下一個代碼:

<table cellpadding="0" cellspacing="0" class="floatedTable">
            <tr>

                <td class="auto-style15">
                    <div id="content">
                    <div class="demo-container" style="position:absolute; width:75%; height:80%; top: 57px; left: 64px;">

            <div id="placeholder" class="demo-placeholder" style="position:absolute; width:95%; height:95%; top: 17px; left: 24px;"></div>

            </div>
                        </div>
                </td>

            </tr>
            </table>

其中class="floatedTable"是:

.floatedTable {
             width: 100%;
             height:100%;
           }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM