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

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.

主站蜘蛛池模板: 保靖县| 宁强县| 阿巴嘎旗| 大安市| 阜康市| 金山区| 舞钢市| 吕梁市| 广水市| 兴安县| 台南市| 黎川县| 布拖县| 清水县| 手机| 淮安市| 淮安市| 农安县| 上饶县| 沂水县| 大悟县| 汽车| 凤庆县| 甘泉县| 潮州市| 十堰市| 伊金霍洛旗| 随州市| 隆化县| 治多县| 沂源县| 永济市| 宣威市| 平和县| 哈巴河县| 且末县| 麻栗坡县| 阳山县| 尉犁县| 东丰县| 克东县|