Yang
Yang

Reputation: 6912

flot on android: how to fit the screen size

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

Upvotes: 1

Views: 828

Answers (1)

Yang
Yang

Reputation: 6912

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

Upvotes: 3

Related Questions