2012-10-01 59 views
0

的幫助下,我通過這個網址繪製圖表與谷歌API

String urlForLineChart ="http://chart.apis.google.com/chart?" + 
       "cht=lc&" + 
       "chs=200x125&" + 
       "chxl=0%3a|1|2|3|4|5|6|7|8|9|10&"+ 
       "chd=t:10,3,5,8,15,20&"+         
       "chxt=x,y&"+ 
       "chds=0,50&"+ 
       "chxr=0,0,16%7C1,0,50&"+ 
       "chm=s,FF0000,1,0,5"; 

要製作圖表,但不代表期望的結果好心幫我。 我不知道如何傳遞參數。我搜索了很多。


我做如下

WebView mCharView = (WebView) findViewById(R.id.char_view); 
mCharView.loadUrl(urlForLineChart); 
+1

什麼是你想要的結果。您的網址[似乎生成圖表](http://chart.apis.google.com/chart?cht = lc&chs = 200x125&chxl = 0%3a | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10&CHD = T:10,3,5,8,15,20&chxt = X,Y&CHDS = 0,50&反饋網站0,0,16%7C1,0,50&CHM = S,FF0000,1,0,5)。 –

回答

1

必須在您的WebView啓用Javascript:

webview = (WebView) findViewById(R.id.webview); 
webview.getSettings().setJavaScriptEnabled(true);