flot on android: how to fit the screen size

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-15 11:20:07

问题


I'm trying to use flot to plot something on the webview but hard to get the figure to fit nicely according to the screen size. It seems that only absolute size is accepted, while I change it to relative, the figure disappeared:

<div id="placeholder" style="width:80%;height:40%;"></div>

An example you can try is here from someone else: Using Flot's Bar Graph in an Android WebView with Highlighting


回答1:


problem solved. I have to use the device-width:

<div id="graphHolder" STYLE="height:200px;width:device-width"></div>

thanks to How to set device height and width for a bar chart in android



来源:https://stackoverflow.com/questions/9895663/flot-on-android-how-to-fit-the-screen-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!