Click here to Skip to main content
13,553,262 members
Click here to Skip to main content
Add your own
alternative version


35 bookmarked
Posted 9 Feb 2009
Licenced CPOL

Fusion Charts Helper Class for ASP.NET 2.0 (C#)

, 9 Feb 2009
Rate this:
Please Sign up or sign in to vote.
This helper class makes it easy to work with Fusion Charts.


Fusion Charts help you to create animated and interactive Flash charts for web and desktop applications. You have to create the XML and pass it to the provided SWF files for each graph type. This helper class facilitates the process of creating the required XML and in the integration with the ASP.NET page.

Using the Code

The code lies in three files:

  1. Charts.cs

    This file contains FusionChartBase (abstract), FusionPieChart, FusionLineChart, and FusionChartUtility.

  2. DataSetHelper.cs

    This file is not related to Fusion Charts. It is a collection of useful code that I found here and there. You should check this out.

  3. Default.aspx

    The page contains two DIVs and a Button. Pie and line charts are loaded into the DIVs on the Button's Click event.

The classes are quite long, so I'm only including the button click code here:

protected void btnShow_Click(object sender, EventArgs e)
    FusionPieChart pieChart = new FusionPieChart();
    pieChart.showNames = true;
    pieChart.showPercentageInLabel = true;
    pieChart.showPercentageValues = false;
    string chartHtml = pieChart.CreateSetElement(BuildData(), FusionPieChart.Pie3D, 
                       divPieChart.ClientID, "name", "value", 
                       "text", "id", "test.aspx?id=", true, 600, 400);
    divPieChart.InnerHtml = chartHtml;

    FusionLineChart lineChart = new FusionLineChart();
    //chartHtml = lineChart.CreateSetElememtForTrendChart(BuildData(), 
                  divLineChart.ClientID, "name", "value", 100, 100);
    chartHtml = lineChart.CreateSetElement(BuildData(), FusionLineChart.Line2D, 
                divLineChart.ClientID, false, "", "name", 
                "value", "text", "id", "", true, 600, 400);
    divLineChart.InnerHtml = chartHtml;

Points of Interest

I did not use Adobe Flex because it was taking too much time for me to develop graphs, and Fusion Charts offered me a quick solution, but it has a number of limitations. After creating all these classes, I had to switch back to Adobe Flex. I used the Fusion Charts XML passing approach with Adobe Flex, and life is beautiful. :-)


  • 9th February, 2009: Initial post


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Shahid Syed
Software Developer (Senior) Mobile Complete Inc. (DeviceAnywhere)
Pakistan Pakistan
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralHi Pin
Vijay9166-Jun-09 0:28
memberVijay9166-Jun-09 0:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01-2016 | 2.8.180515.1 | Last Updated 9 Feb 2009
Article Copyright 2009 by Shahid Syed
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid