How to display static Line Chart Graph on ASP.NET Web Page

Hi Friend, Today we will learn about Line Chart control in you can easily display the Line  Graph of any predefined data.I have already display the Bar graph of predefined data.Same concepts will be used in Line Graph also but you have to change somethings as given below. Here I have represented three persons(Rajesh,Kiran and Sachin) earning details in this Line Graph .Before implementing this concepts ,you have to install Ajax Toolkit in your visual studio.
There are some some steps to implement this whole concepts as given below:-

Step 1:First open your visual studio-->File -->New-->Web Site-->Select ASP.NET Empty website-->OK-->Now open Solution Explorer Window-->Add a New page(Default.aspx)-->Open Toolbox-->drag and drop  ajax ToolkitScriptManager control on the page.

Step 2:Now open Source file-->Drag and drop LineChart control from the Toolbox-->Sets their properties and sets the properties of LineChartSeries also as given below:-
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
        <span class="style1"><strong>How to display Static LineChart on ASP.NET Webpage</strong></span><br />
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        <asp:LineChart ID="LineChart1" runat="server" ChartWidth="450" ChartHeight="300" ChartType="Basic" 
        ChartTitle="Earings in Different Years" CategoriesAxis="2001,2002,2003,2004,2005,2006,2007,2008" 
        ChartTitleColor="#0E426C" CategoryAxisLineColor="#D08AD9" ValueAxisLineColor="#D08AD9" BaseLineColor="#A156AB"> 
       <asp:LineChartSeries Name="Rajesh" LineColor="#CC66FF" 
        Data="5006, 500, 3500, 4400,1600, 5400,4700,8930" />
       <asp:LineChartSeries Name="Kiran" LineColor="#3399FF" 
       Data="9900, 4000, 11600, 9700,3200, 8600,6900,9950" />
       <asp:LineChartSeries Name="sachin" LineColor="#FF0066" 
       Data="12000, 17000, 1500, 8400,9600, 11900,17600,12030" />

Step 3:Now Run the Application(press F5)-->You will See following output a shown below:-

For More...
  1. c# learning Tutorials
  2. mvc 4 tutorial
  3. for beginners
  4. online training
  5. project
  6. visual studio 2012 tutorial
Download Whole Attached File


Post a Comment

Powered by Blogger.