官术网_书友最值得收藏!

Time for action — set up FusionCharts for our first chart

  1. Create a folder on your hard-drive to centrally store all the examples that we will build iteratively. If you are working on a web server, you can create this under the root folder of the web application. Let us name it as LearningFusionCharts. You can give it any other name as well.

    Tip

    Downloading the example code

    You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

  2. Create a subfolder called FusionCharts within this folder. This folder will contain all the SWF and JavaScript files of FusionCharts, which are the FusionCharts Core files. If you are working on a web server, create this folder under the root of the web application, so that the entire web application can conveniently access this.
  3. Copy all the SWF and JS files from the Charts folder under the FusionCharts Installation Folder (where you had earlier downloaded and extracted the FusionCharts ZIP file) to the newly created FusionCharts folder. This step completes the installation of FusionCharts for your application.
  4. Create another folder under LearningFusionCharts and name it as FirstChart. This will be used to store the XML data and the HTML file for our first chart.

    Tip

    Upgrading the FusionCharts version, or converting from trial to licensed

    If you are upgrading to a newer version of FusionCharts, or converting from evaluation to a licensed version, all you need to do is copy the SWF and JS files from the new or licensed version and overwrite the existing files in the FusionCharts folder.

What just happened?

You just installed FusionCharts. It involved copying of all the SWF and JavaScript files of FusionCharts, which are the FusionCharts Core files. If you intend to plot just a subset of chart types, you can select only those SWF files and paste them here. However, copying all files makes it easier in the future whenever you need to create a new chart type in your application. Each SWF file is used to plot a particular type of chart in Flash and the name of the file represents the chart type. You can find the complete list of charts in FusionCharts Documentation | Introduction | List of Charts. For our first chart, we are going to use Column3D.swf to plot a 3D Column chart.

The FusionCharts folder also contains six JavaScript files that aid in embedding and configuring charts, along with rendering them in JavaScript when viewed on devices that do not support Flash. These files are as follows:

While creating your chart, as you will soon see, you just need to include FusionCharts.js in your page. The other files such as FusionCharts.HC.js, FusionCharts.HC.Charts.js, and jquery.min.js are dynamically loaded by the code in FusionCharts.js.

With the basic setup in place, let us focus on the data for our chart.

主站蜘蛛池模板: 石景山区| 容城县| 虹口区| 布拖县| 五华县| 北安市| 瓮安县| 孝昌县| 绥化市| 体育| 罗江县| 铁力市| 马关县| 屏南县| 宁乡县| 崇信县| 肇州县| 科技| 布尔津县| 开鲁县| 新密市| 南京市| 临汾市| 本溪市| 安图县| 峡江县| 新乡县| 潜江市| 兴业县| 龙川县| 桐乡市| 湖州市| 武清区| 苗栗县| 镇巴县| 边坝县| 兴化市| 乌鲁木齐县| 新源县| 瑞丽市| 始兴县|