c#.net画图很好用的控件 dotnetCHARTING
2007-11-09 09:30
246 查看
最近发现一个很好用的控件 dotnetCHARTING ,画图真的很方便,而且功能很多,可以画各种各样的图
在官方网站上下载的需要注册,现在网上有破解办的下载的(需要的朋友可以给我留言,发到邮箱)
下面介绍一个我写的例子(c#)
1.在的aspx也面上添加chart
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div style="text-align:center;">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<dotnetCHARTING:Chart ID="Chart1" runat="server" Height="200px" Width="740px">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</dotnetCHARTING:Chart>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
2.头文件上加:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using dotnetCHARTING;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using System.Drawing;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
在后台cs文件load中添加代码:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Chart1.Debug = false;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Chart1.Type = ChartType.Combo;//Horizontal;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Chart1.Title = "10位统计图";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Chart1.TempDirectory = "temp";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
// Chart1.ShadingEffect = true;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Chart1.Use3D = true;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Chart1.DefaultSeries.DefaultElement.ShowValue = true;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Chart1.SeriesCollection.Add(getData());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
3.添加getDate()函数
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
public SeriesCollection getData()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
SeriesCollection SC = new SeriesCollection();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// DataTable mydt = CreateDataTable();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Series s1 = new Series();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
s1.Name = "总用户";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
for(int i=0;j<10;i++)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Element e = new Element();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
e.Name = "点"+i;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
e.YValue =i+1;
s1..Elements.Add(e);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
SC.Add(s1);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
SC[0].DefaultElement.Color = Color.FromArgb(49, 255, 49);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return SC;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
好,大功告成可以看到一个图了
在官方网站上下载的需要注册,现在网上有破解办的下载的(需要的朋友可以给我留言,发到邮箱)
下面介绍一个我写的例子(c#)
1.在的aspx也面上添加chart
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div style="text-align:center;">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<dotnetCHARTING:Chart ID="Chart1" runat="server" Height="200px" Width="740px">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</dotnetCHARTING:Chart>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
2.头文件上加:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using dotnetCHARTING;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
using System.Drawing;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
在后台cs文件load中添加代码:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Chart1.Debug = false;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Chart1.Type = ChartType.Combo;//Horizontal;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Chart1.Title = "10位统计图";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Chart1.TempDirectory = "temp";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
// Chart1.ShadingEffect = true;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Chart1.Use3D = true;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Chart1.DefaultSeries.DefaultElement.ShowValue = true;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Chart1.SeriesCollection.Add(getData());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
3.添加getDate()函数
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
public SeriesCollection getData()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
SeriesCollection SC = new SeriesCollection();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// DataTable mydt = CreateDataTable();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Series s1 = new Series();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
s1.Name = "总用户";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
for(int i=0;j<10;i++)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Element e = new Element();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
e.Name = "点"+i;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
e.YValue =i+1;
s1..Elements.Add(e);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
SC.Add(s1);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
SC[0].DefaultElement.Color = Color.FromArgb(49, 255, 49);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return SC;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
好,大功告成可以看到一个图了
相关文章推荐
- C#.net使用DotNetCharting控件生成报表统计图
- dotnetCHARTING 画图控件
- C#.net使用DotNetCharting控件生成报表统计图--A
- 让服务器控件执行js与C#两种代码(asp.net)
- 如何使用 WebBrowser 控件在 Visual C# 2005 或 Visual C# .NET 中打开 Office 文档
- [转]VB.NET和C#.NET中控件数组的建立
- asp.net C# FileUpload 控件如何判断文件名的后缀
- ASP.NET 2.0(C#)中使用webpart系列控件(4)
- 一个蛮不错的图形绘制控件 dotnetCHARTING (提供license下载)
- C#.net 地图控件开发(十一) 地图控件MapControl
- asp.net,C#,html控件的File控件实现多文件上传简单实例,vs2010
- 在ASP.Net With C# 中使用 DataGrid 控件分页展示数据
- C#命名规范,控件、数据类型、ADO.NET等
- ASP.NET用户控件事件的定义和实践--C#里的委托和事件实现Observer
- ASP.NET C#验证码控件使用
- C#.NET 封装自定义组件(控件)Dll
- 图像处理控件ImageGear for .NET教程:C# WPF应用程序创建示例(1)
- 一个很强大的ASP.NET画图控件(一)
- asp.net(c#)页面加载时添加控件的属性和回车问题
- C#发现之旅 --- WinForm.NET中开发具有固定背景图片的可滚动控件