开源Flash Chart使用

.FusionCharts 是一个跨浏览器和跨平台的flash图表组件,能够被 ASP.NET, ASP, PHP, JSP, ColdFusion, Ruby on Rails, 简单 HTML 页面 甚至PPT调用. 几乎所有你知道的语言它都支持。采用xml作为图表的数据。

 

1.       下载:http://www.fusioncharts.com/Free/

2. 安装:Installation of FusionCharts Free for your web application is just a two-step affair:

1.       Create a folder named FusionCharts in the root of your application (though, it's not mandatory to name the folder as FusionCharts or create it under root folder. However, it organizes things a lot more, as all the pages within your website can now access the common set of charts).

2.       Copy all the SWF files from Download Package > Charts Folder and paste it in this folder.

建一个文件包,将所有的swf文件copy到其中,还有一个FusionCharts.js

Installation Complete - Yes, there's no more step involved - you're now ready to use FusionCharts in your web application, which will soon see.

3.使用:

<HTML>

<HEAD>

<TITLE>FusionCharts Free & JavaScript - Updating chart using updateChartXML() Method</TITLE>

<style type="text/css">

<!--

body {

        font-family: Arial, Helvetica, sans-serif;

        font-size: 12px;

}

-->

</style>

<SCRIPT LANGUAGE="Javascript" SRC="../../FusionCharts/FusionCharts.js"></SCRIPT>

<SCRIPT LANGUAGE="JavaScript">

        /*

         * updateChart method is called, when user clicks the button

         * Here, we generate the XML data again and build the chart.            

         *    @param  domId     domId of the Chart

        */

        function updateChart(domId){

               //using updateChartXML method defined in FusionCharts.js

               updateChartXML(domId,"<graph><set name='A' value='32' /></graph>");

               //Disable the button

               this.document.frmUpdate.btnUpdate.disabled = true;

        }

</SCRIPT>

</HEAD>

<BODY>

<CENTER>

        <h2>FusionCharts Free & JavaScript - Updating chart using updateChartXML() method</h2>

       

        <div id="chart1div">

               FusionCharts

        </div>

        <script language="JavaScript">                                

               var chart1 = new FusionCharts("../../FusionCharts/FCF_Column3D.swf", "chart1Id", "400", "300", "0", "1");       //引用生成的图表样式                  

               chart1.setDataXML("<graph><set name='A' value='10' color='D64646' /><set name='B' value='11' color='AFD 8F 8' /></graph>");   //设置xml数据

               chart1.render("chart1div");

        </script>

        <BR />

        <form name='frmUpdate'>

        <input type='button' value='Change Data' onClick="javaScript:updateChart('chart1Id');" name='btnUpdate' />       

        </form>

</CENTER>

</BODY>

</HTML>

 

 

 

<div id="chart1div">    This text is replaced by the chart. </div> <script type="text/javascript">    var chart1 = new FusionCharts("Column2D.swf", "ChId1", "600", "400", "0", "0");    chart1.setDataURL("Data.xml");    chart1.render("chart1div"); </script>

 

 

  1. 注意:You need to have Adobe Flash Player 6 (or above) installed on your machine to view the charts.

 

二.Open Flash Chart - Open Flash Chart 是一个 Flash 图表组件,很容易安装,提供以下语言的API PHP, Perl, Python, Java, Ruby on Rails, and .Net 来控制图表。

下载:http://teethgrinder.co.uk/open-flash-chart/

可参考:http://crabdave.javaeye.com/blog/189653

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值