我想在 android 2.2 上使用 FusionCharts(可能在模拟器上)。我尝试使用 Javascript 和 HTML,但没有得到预期的结果。
有什么帮助吗??
我的代码如下:
WebView web;
/** Called when the activity is first created. */
@Override
public void on Create(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
web=(WebView)findViewById(R.id.webView1);
web.loadUrl("file:///android_asset/Fusioncharts/myChart.html");
}
}
还有我的 html,xml 文件:
<html>
<head>
<title>My First chart using FusionCharts
</title>
<script type="text/javascript" src="JavaScripts/FusionCharts.js">
</script>
</head>
<body>
<div id="chartContainer">FusionCharts will load here!
</div>
<script type="text/javascript">
<!--
var myChart = new FusionCharts("Pie2D.swf? dataURL=Data.xml","myChartId", "400", "300", "0", "1" );
myChart.setXMLUrl("Data.xml");
myChart.render("chartContainer");
// -->
</script>
</body>
</html>
和 Data.xml :
上面的代码只是显示我:FusionCharts 将在这里加载!
谢谢斯内哈
_