Fusioncharts free chart Library

Source: Internet
Author: User

Free.
Version
3. The features of the free version are already very powerful and I can't help it. Based on the XML data format. PairCodeAfter a slight processing, the flash chart can be displayed after the data is transmitted as parameters in XML format. Has a single series (single
Series) rendering, and multiple series (Multi-series) rendering. 3D or 2D bar, pie, block, or linear representation. You can even display lines and columns in a dazzling manner ......

After downloading this chart library, uncompress the package and provide detailed documentation and support libraries and style libraries. To create your own chart, you must load the fusioncharts. js library under the jsclass directory. You can find the desired dynamic language support library in the Code directory. These support libraries provide functions to present flash charts after passing parameters, which is very important.

To use ASP dynamic scripting language, you must include the Code \ ASP \ shortdes \ fusioncharts. asp file in the script. Suppose that the file has been copied to the INC directory of your site, it should include:

<! -# Include file = "INC/fusioncharts. asp"->

Of course, you must load the jsclass \ fusincharts. js file. Assume that the file has been copied to the JS directory of your site. Load the file as follows:

<Script language = "JavaScript" src = "JS/fusioncharts. js"
> </SCRIPT>

To present a 3 D pie chart, you need to find the fcf_pie3d.swf file in the chartsdirectory. Assume that the file has been copied to the charts of your site. You can view the pie3d. xml file in the gallery \ data \ directory. The format is very simple. This is the simplest and most clear XML format among the many chart tools I have seen.

Put a <Div id = "MyChart"> </div> element in the Dom. The chart is displayed in this element.

The next step is to extract records from the database and convert the records into pie3d. and then call fusioncharts. the renderchart process in ASP enables the chart to be presented according to the actual data of the database.

Assume that the mconn object of the database record set has been obtained. An object is a group of two-dimensional data tables named "name" and "quantity. Use this code to convert to XML format:

<%
Dim xmlstr 'defines string variables in XML format
Xmlstr = "<graph shownames = '1 ′
Decimalprecision = '0'> "'refers to the first line in pie XML format.
Mconn. movefirst the dataset Pointer Points to the first line
Do
While not mconn. EOF 'traverses the dataset until the oldest row of the dataset.
Xmlstr = xmlstr & "<set name = '"
& Mconn ("name") & "'value = '" & mconn ("quantity") & "'/>"
'The record of the current row is converted in pie XML format
Mconn. movenext the dataset Pointer Points to the next row.
Loop
Xmlstr = xmlstr
& "</Graph>" 'refers to the end row in pie XML format

'Currently, The xmlstr variable is obtained. Call the renderchar process to pass the variable over. Generate charts.

Call renderchart ("charts/fcf_pie3d.swf", "", xmlstr, "MyChart", 600,
400)

'The process has six parameters: chartswf, strurl, strxml, chartid, chartwidth, chartheight.

'100 parameters are the path of the Flash file of the specified pie style. Here is charts/fcf_pie3d.swf.
The '100 parameters are used to specify the path of the XML data file. This is not required because the XML format variable is directly passed, so it is null.
'The third parameter is the most changed to the XML format. Here is xmlstr, which is the variable just generated from the DataSet object. The 2nd and 3rd parameters cannot have values at the same time. Otherwise, you do not know whether to retrieve the file data or the variable data.
The '100 parameter indicates the DIV element in which the process will be rendered. Here is MyChart.
The 5th and 6th Parameters specify the width and height of the chart.

%>

Once the script is run, the chart is displayed, and the appearance animation and auto-calculated percentage are also displayed. Take a closer look at the document and specify the color of each data item in the pie chart.

To present a chart of other styles, analyze the XML format accepted by the chart, and create a variable to pass it over. Of course, you need to change the Flash file of the corresponding chart.

XML data can be either file data or variable data. Loading file data is not necessarily a. xml file. It can be a processing script, such as ASP or PHP. The processing script can accept the values sent from get. After processing the data, print it in XML format. However, after my tests, the script file data is not easy to use, and often cannot be reflected on the chart after the data is updated. It usually takes effect after the browser cache is cleared. I have not tested using scripts to generate real. XML data files, which is too troublesome. Directly transferring variables is very easy ......

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.