MS Chart Tutor -1 : Asp.net
In this article we are going to study the basic chart to use in aspx pages.
It is a basic chart formation in aspx pages.
Previous articles :
Source code download
http://sites.google.com/site/novadwnload/basicchart-tutor-1
ASPX Code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UserOnline.aspx.cs" Inherits="Roles_AdminNew_Charts_UserOnline" %>
<%@ Register Assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI.DataVisualization.Charting" 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>
<link href="Common/_assets/css/Corner.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div>
<div class="dialog">
<div class="hd">
<div class="c"></div>
</div>
<div class="bd">
<div class="c">
<div style="text-align:center;">
New cool charts
</div>
<div style="text-align:center;">
<asp:Chart ID="Chart1" runat="server" Height="174px" Width="189px"
BackImage="~/Common/_assets/img/bg.jpg">
<BorderSkin BackColor="Black" />
<series><asp:Series Name="Series1"></asp:Series></series>
<chartareas>
<asp:ChartArea Name="ChartArea1" ShadowColor="Gray"></asp:ChartArea></chartareas>
</asp:Chart>
</div>
</div>
</div>
<div class="ft">
<div class="c"></div>
</div>
</div>
</div>
</form>
</body>
</html>
Aspx.cs Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.DataVisualization.Charting;
public partial class Roles_AdminNew_Charts_UserOnline : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Series series = new Series("Spline");
series.ChartType = SeriesChartType.Bar;
series.BorderWidth = 3;
series.ShadowOffset = 2;
// Populate new series with data
series.Points.AddY(67);
series.Points.AddY(57);
series.Points.AddY(83);
series.Points.AddY(23);
series.Points.AddY(70);
series.Points.AddY(60);
series.Points.AddY(90);
series.Points.AddY(20);
// Add series into the chart's series collection
Chart1.Series.Add(series);
string a = Utilities.Crawl("http://google.com");
}
}
For rounded corner
http://docs.jquery.com/Tutorials:Rounded_Corners#Example_And_Code
This entry was posted on Thursday, May 14, 2009 at 3:25 AM. You can follow any responses to this entry through the RSS 2.0. You can