Table of Contents
File
> New
> Web Site
. New Web Site
dialog box opens. ASP.NET Empty Web Site
. Enter the website name and click OK
. New Web site
window. Add
. Click the Add New Item
option. Add New Item
a dialog box opens. Add New Item
dialog box, in the list of available templates, select Web Form
. Click Add
to connect the template to your app. Add
and click Reference
. Reference Manager
dialog box opens. Reference Manager
dialog box, select Browse
. From the list of packages available, select FusionCharts.dll
. Click OK
. Solution Explorer
, right-click on the website name and select Add
. Click New Folder
to create a new folder. Rename this folder to Scripts
. JS
folder of the FusionCharts package and paste them into the Scripts
folder. Default.aspx
file. This code will produce the interface for the app. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html> <html xmlns="https://www.w3.org/1999/xhtml"> <head runat="server"> <title>FusionCharts Integration in a Simple ASP.NET Web Aplication</title> <script src="Scripts/fusioncharts.js"></script> <script src="Scripts/fusioncharts.charts.js"></script> </head> <body> <form id="form1" runat="server"> <asp:Literal ID="chart" runat="server"></asp:Literal> </form> </body> </html>
data.json
file within the website hierarchy and add the following chart data source code in the file. { "chart": { "caption": "Monthly revenue for last year", "subCaption": "Harry's SuperMart", "xAxisName": "Month", "yAxisName": "Revenues (In USD)", "numberPrefix": "$", "paletteColors": "#0075c2", "bgColor": "#ffffff", "borderAlpha": "20", "canvasBorderAlpha": "0", "usePlotGradientColor": "0", "plotBorderAlpha": "10", "placevaluesInside": "1", "rotatevalues": "1", "valueFontColor": "#ffffff", "showXAxisLine": "1", "xAxisLineColor": "#999999", "divlineColor": "#999999", "divLineIsDashed": "1", "showAlternateHGridColor": "0", "subcaptionFontBold": "0", "subcaptionFontSize": "14" }, "data": [ { "label": "Jan", "value": "420000" }, { "label": "Feb", "value": "810000" }, { "label": "Mar", "value": "720000" }, { "label": "Apr", "value": "550000" }, { "label": "May", "value": "910000" }, { "label": "Jun", "value": "510000" }, { "label": "Jul", "value": "680000" }, { "label": "Aug", "value": "620000" }, { "label": "Sep", "value": "610000" }, { "label": "Oct", "value": "490000" }, { "label": "Nov", "value": "900000" }, { "label": "Dec", "value": "730000" } ], "trendlines": [ { "line": [ { "startvalue": "700000", "color": "#1aaf5d", "valueOnRight": "1", "displayvalue": "Monthly Target" } ] } ] }
Default.aspx.cs
file. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using FusionCharts.Charts; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Chart newChart = new Chart("column2d", "simplechart", "600", "400", "jsonurl", "data.json"); chart.Text = newChart.Render(); } }
Ctrl + F5
to render the chart in the browser. If you follow all steps correctly, your chart should display in your web app, similar to the image below: We’re excited to announce the upcoming release of FusionCharts v4.1—a groundbreaking step forward in the…
Have you ever been overwhelmed by a massive data set and wondered, "How do I…
If you’ve ever tried to make sense of the stock market, you’ve probably come across…
Imagine you’re comparing the sales performance of your top product lines across different regions, or…
Have you ever spent hours buried in documentation, hunting for a specific piece of code?…
Do you feel like your data is a cryptic puzzle, locked away from revealing its…
View Comments
Thank you for some other fantastic post. Where else could anybody get that kind of info in such a perfect method of writing? I have a presentation subsequent week, and I am on the search for such info.
I am beginner to ASP.Net. I am obliged for this informative post, I have got many new points and has cleared my doubts about charting. It also helped me understand this topic in more detailed way.
thanks and nice tips
well explained.........
gets lot of information after reading your blog....
thanks for sharing.....keep updating........