fusionchart使用说明

data.xml 的格式可如下:

<?xml version="1.0" encoding="GBK">
<chart ...>
	<categories ...><!--此处代码x轴-->
		<category label=""/>
		<category label=""/>
	</categories>
	<dataset seriesname="新品" ...>
		<set value="0"/>
		<set value="0"/>
	</dataset>
	<dataset seriesname="堪品" ...>
		<set value="0"/>
		<set value="0"/>
	</dataset>
	<dataset seriesname="待修品" ...>
		<set value="0"/>
		<set value="0"/>
	</dataset>
	<dataset seriesname="待废品" ...>
		<set value="0"/>
		<set value="0"/>
	</dataset>
<styles>
<definition>
	<style .../>
	<style .../>
</definition>
<application>
	<apply .../>
	<apply .../>
</application>
</styles>
</chart>
以上...代码省去属性,具体属性设置参照API。

在java 文件中返回:

JSONObject jObj = new JSONObject();
Chart chart = new Chart();
String chartHTMLCode = chart.createChartHTML("/web/plug-in/fusioncharts/swf/MSColumn3D.swf","",xml.toString(),"myFirst",width,height,false);
jObj.put("msg",charHTMLCode);
jObj = JSONObject.fromObject(jObj);
response.setHeader("Cache-Control","no-cache");
response.setContentType("text/html; charset=utf-8";
response.getWriter.write(jObj.toString());



你可能感兴趣的:(fusionchart使用说明)