//指定图表是否需要图例标注
 InsertChart.HasLegend = false;
 
 InsertChart.HasTitle = true;//为图表添加标题
 InsertChart.Title.Caption = "2006年清清月儿每个月花销流水账";//标题名称
 //为x,y轴添加图示说明
 InsertChart.Axes[0].HasTitle = true;
 InsertChart.Axes[0].Title.Caption = "";//月份
 InsertChart.Axes[1].HasTitle = true;
 InsertChart.Axes[1].Scaling.SplitMinimum = 200;
 InsertChart.Axes[1].Title.Caption = "数量";
 //添加一个series系列
 InsertChart.SeriesCollection.Add(0);
 //给定series系列的名字
 InsertChart.SeriesCollection[0].SetData(ChartDimensionsEnum.chDimSeriesNames, +(int)ChartSpecialDataSourcesEnum.chDataLiteral, strSeriesName);
 //给定分类
 InsertChart.SeriesCollection[0].SetData(ChartDimensionsEnum.chDimCategories, +(int)ChartSpecialDataSourcesEnum.chDataLiteral, strXdata);
 //给定值
 InsertChart.SeriesCollection[0].SetData(ChartDimensionsEnum.chDimValues, (int)ChartSpecialDataSourcesEnum.chDataLiteral, strYdata);
 //输出文件.
 string strAbsolutePath = (Server.MapPath(".")) + "\\ShowData.gif";
 laySpace.ExportPicture(strAbsolutePath, "GIF", 400, 250);
 //创建GIF文件的相对路径.
 string strRelativePath = "./ShowData.gif";
 //把图片添加到placeholder中,并在页面上显示
 string strImageTag = " ";
";
 this.PlaceHolder1.Controls.Add(new LiteralControl(strImageTag));
 }
}
前台代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="OWCdrawing.aspx.cs" Inherits="OWCdrawing" %>
 清清月儿http://blog.csdn.net/21aspnet
 
数据库SQL脚本:
USE [web]
GO
/****** 对象: Table [dbo].[Chart] 脚本日期: 03/27/2007 22:26:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Chart](
 [id] [int] IDENTITY(1,1) NOT NULL,
 [month] [smallint] NULL,
 [Allcount] [int] NULL
) ON [PRIMARY]
在数据库建好表以后要自己手动假想有12条数据,手动添加,最终结果类似下图:

后台程序说明:
最关键就是InsertChart.Type = ChartChartTypeEnum.chChartTypeColumnClustered;
你可以在ChartChartTypeEnum后点出其他方法。如图所示:

下面列出的是其他类型图:
最新最全的Asp.Net教程:/HtmlData/Program/ASP.NET/ 
折线图:

 
面积图:

条形图:

OWC什么图形都可以画,还能画立体的,请大家自己尝试。
可以参考OWC手册,具体位置:
C:\Program Files\Common Files\Microsoft Shared\Web Components\11\2052\OWCVBA11.CHM