基本信息
源码名称:asp.net 用dotnetcharting控件生成柱形图、饼形图、折线趋势图
源码大小:0.20M
文件格式:.rar
开发语言:C#
更新时间:2013-05-08
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍

实例中的dotnetCHARTING.dll 文件即是 dotnetcharting控件,饼形图、柱形图等详见 核心代码部分

这是官方网址: http://www.dotnetcharting.com/

2d柱形图

3d饼形图

 

曲线走势图

 

<%@ Page Language="C#" Description="dotnetCHARTING Component"%>
<%@ Register TagPrefix="dotnet"  Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%>
<%@ Import Namespace="System.Drawing" %>


<script runat="server">

SeriesCollection getRandomData()
{
 SeriesCollection SC = new SeriesCollection();
 Random myR = new Random();
 for(int a = 0; a < 4; a  )
 {
  Series s = new Series();
  s.Name = "Series "   a;
  for(int b = 0; b < 5; b  )
  {
   Element e = new Element();
   e.Name = "E "   b;
   e.YValue = myR.Next(50);
   s.Elements.Add(e);
  }
  SC.Add(s);
 }

 // Set Different Colors for our Series
 SC[0].DefaultElement.Color = Color.FromArgb(49,255,49);
 SC[1].DefaultElement.Color = Color.FromArgb(255,255,0);
 SC[2].DefaultElement.Color = Color.FromArgb(255,99,49);
 SC[3].DefaultElement.Color = Color.FromArgb(0,156,255);
 return SC;
}


void Page_Load(Object sender,EventArgs e)
{
 // Set the title.
 Chart.Title="My Chart";


 // Set the x axis label
 Chart.ChartArea.XAxis.Label.Text="X Axis Label";

 // Set the y axis label
 Chart.ChartArea.YAxis.Label.Text="Y Axis Label";

 // Set the directory where the images will be stored.
 Chart.TempDirectory="temp";

 // Set the bar shading effect
 Chart.ShadingEffect = true;

 // Set he chart size.
 Chart.Width = 600;
 Chart.Height = 350;

 // Add the random data.
 Chart.SeriesCollection.Add(getRandomData());
    
    
}
</script>
<HTML><HEAD><TITLE>Gallery Sample</TITLE></HEAD>
<BODY>
<DIV align=center>
 <dotnet:Chart id="Chart"  runat="server"/>
</DIV>
</BODY>
</BODY>
</HTML>