How to use Open Flash Chart to create exquisite network charts

Source: Internet
Author: User

Open Flash Chart. NET

Open Flash Chart. NET (OFC. NET) is based on Open Flash Chart project, web site in http://teethgrinder.co.uk/open-flash-chart (or SourceForge). You can also get source code through SVN: http://svn.k2colocation.com/svn/OpenFlashChart.

Installation Steps:

1. First, create a file in the root directory of the application (. net project ).Aspnet_clientFolder.

2,In the aspnet_clientCreate a folder under the folderOpenFlashChArt.

3.OpenFlashChartCreate a folder under the folderJsAnd add file oPen-flash-chart.swf

4. Add files to the js folderSwfobject. js

5,Add reference to OpenFlashChart. dll

6. Add Defaul. aspx and Data. aspx pages.

The folder structure of the project is as follows:

To call OFC. NET on the page, you must first register the Assembly and add the following statement at the top of the Default. aspx page:

<%@Register TagPrefix="ofc" Namespace="OpenFlashChart" Assembly="OpenFlashChart" %> 

Then add the control to the page. The Code is as follows:

    <ofc:Chart ID="Chart" Height="500" Width="800" Url="data.aspx" runat="server" /> 

Data. aspx. csThe file code is as follows:

Using System; using System. collections. generic; using System. web; using System. web. UI; using System. web. UI. webControls; using OpenFlashChart; using System. collections; namespace OpenFlashChartDemo {public partial class data: System. web. UI. page {protected void Page_Load (object sender, EventArgs e) {Graph graph = new Graph (); graph. legendX = new LegendX ("group statistics by category", 12, "# FF0000"); graph. labelsX. add ("moss"); graph. labelsX. add ("fern"); graph. labelsX. add ("Naked plants"); graph. labelsX. add ("quilt"); graph. stepsY = 5; graph. maxY = 50; OpenFlashChart. charts. chartData temp; // Bar (alpha (transparency), color (Hex), Label, Line Size) temp = new OpenFlashChart. charts. bar (75, "# FF0000", "Sales", 2); temp. data. add (20); temp. data. add (30); temp. data. add (40); temp. data. add (10); graph. data. add (temp); Response. clear (); Response. write (graph. toString (); Response. end ();}}}

You can download the entire program and the example package openflash.rar (369.61 kb) here)

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.