FusionCharts制作报表

来源:互联网 发布:php代码大全 编辑:程序博客网 时间:2024/05/31 13:16
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<script language="JavaScript" src="FusionCharts.js" ></script>
<title>FusionCharts</title>
</head>
<body>

<table align='center' border="1">
<caption>图</caption>

<tr>
<td>
<div id='Pie' align="center">
<script type="text/javascript">
var chart = 
new FusionCharts('Column3D.swf', "ChartId", "400", "300");
chart.setDataURL("data.xml");  
chart.render('Pie');
                        </script>
</div>
</td>
</tr>
   <tr>
<td>
<div id='Pir' align="center">
<script type="text/javascript">
var chart = new FusionCharts('FCF_Column3D.swf', "ChartId", "400", "300");
var str = "<graph caption='Monthly Unit Sales' xAxisName='Month' yAxisName='Units' showNames='1' decimalPrecision='2' formatNumberScale='0'>";
str+="<set name='一月' value='444' color='CCFFFF' hoverText='一月,444' link='http://www.baidu.com'/>";
str+="<set name='二月' value='555' color='F6BD0F'/>";
str+="<set name='三月' value='671' color='8BBA00' />";
str+="<set name='四月' value='494' color='FF8E46'/>";
str+="<set name='五月' value='761' color='008E8E'/>";
                            str+="<set name='六月' value='960' color='D64646'/>";
                            str+="<set name='七月' value='629' color='8E468E'/>";
                            str+="<set name='八月' value='622' color='588526'/>";
                            str+="<set name='九月' value='376' color='B3AA00'/>";
                            str+="<set name='十月' value='494' color='008ED6'/>";
                            str+="<set name='十一月' value='761' color='9D080D'/>";
                            str+="<set name='十二月' value='960' color='A186BE'/>";
                            str+="</graph>";
chart.setDataXML(str);  
chart.render('Pir');
                        </script>
</div>
</td>
</tr>
</table>
</body>

</html>


data.xml文件:

<graph baseFont='SunSim' baseFontSize='12' caption='分析' subcaption='' yAxisMinValue='51650.1' yAxisMaxValue='71118.3' xaxisname='日期' yaxisname='数量' hovercapbg='FFECAA' hovercapborder='F47E00' formatNumberScale='0' decimalPrecision='0' showvalues='1' numdivlines='10' numVdivlines='0' shownames='1' rotateNames='1'>
  <set name='2009-10-04' value='57653' color='AFD8F8'/>
  <set name='2009-10-05' value='57389' color='F6BD0F'/>
  <set name='2009-10-06' value='59256' color='8BBA00'/>
  <set name='2009-10-07' value='62762' color='FF8E46'/>
  <set name='2009-10-08' value='63287' color='008E8E'/>
  <set name='2009-10-09' value='60109' color='D64646'/>
  <set name='2009-10-10' value='64653' color='8E468E'/>
  <set name='2009-10-11' value='61687' color='588526'/>
</graph>