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

By
Hi Friend, Today we will learn about Line Chart control in asp.net.Here 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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <span class="style1"><strong>How to display Static LineChart on ASP.NET Webpage</strong></span><br />
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </asp:ToolkitScriptManager>
        <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"> 
        <Series>
       <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" />
      </Series> 
        </asp:LineChart>
    </div>
    </form>
</body>
</html>

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

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

0 comments:

Post a Comment

Powered by Blogger.