点滴积累,融会贯通

-----喜欢一切有兴趣的东西

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
 

一、图形类型列表

chChartTypeColumnClustered----------垂直柱状统计图
        chChartTypeColumn3D-----------------3D
垂直柱状统计图
        chChartTypeBarClustered---------------
水平柱状统计图
        chChartTypeBar3D--------------------- 3D
水平柱状统计图
        chChartTypeArea-----------------------
区域统计图
        chChartTypeArea3D--------------------3D
区域统计图
        chChartTypeDoughnut------------------
中空饼图
        chChartTypeLineStacked---------------
折线统计图
        chChartTypeLine3D---------------------3D
折线统计图
        chChartTypeLineMarkers---------------
折线带点统计图
        chChartTypePie-------------------------
饼图
        chChartTypePie3D----------------------3D
饼图
        chChartTypeRadarSmoothLine----------
网状统计图
        chChartTypeSmoothLine----------------
弧线统计图  

二、dll下载

下载地址: OWCWebChart.rar

三、使用方法

1、 在引用中引用dll

2、  using OWCWebChart;

3、 使用:

WebChart wc = new WebChart();

string name;

name = wc.show(type,this,datatable,"AAAA题目AAAAA","类别","数量","销售图");

this.Image1.ImageUrl=@"images/"+name;

说明:type-------即图形类型,直接给英文字符串

     this-------即本页面

     datatable中包含两列,第1列为类别,第2列为数量.例如1列为年,2列为销售额

     接下来的4个字符串参数分别是:大标题,类别,数量,和小标题

     name-------是图片名称;

     images------是Web应用程序下与本页面(this)同层的文件夹

4、 具体示例代码:

webconfig文件

<appSettings>

          <add key="Connstring" value="Data Source=(local);User ID=sa;Password=sa;Initial Catalog=pubs" />

</appSettings>

web页面:加入一个Image,将下列代码放在Page_Load中, 在引用中引用dll

加入namespace

using OWCWebChart;

using System.IO;

using System.Configuration;

using System.Data.SqlClient;

代码:

string sql = "SELECT " +"Year(sa.ord_date) As [Year], " +"SUM(sa.qty) As [Qty] " +"FROM " +"sales sa " +"inner join stores st on(sa.stor_id = st.stor_id) " +"GROUP BY " +"Year(sa.ord_date) " + "ORDER BY " + "[Year]";

          string conn = ConfigurationSettings.AppSettings.Get("Connstring");

              SqlDataAdapter da = new SqlDataAdapter(sql,conn);

              DataSet ds = new DataSet();

              da.Fill(ds,"chartData");

              WebChart wc = new WebChart();

              name = wc.show("chChartTypeColumnClustered",this,ds.Tables[0],"AAAAAAAA题目AAAAAAAA","类别","数量","销售图");

    this.Image1.ImageUrl=@"images/"+name;

5、 效果图

6、  注意:本dll仅能在Web项目中使用.本dll封装的是owc10

posted on 2006-05-16 14:16  小寒  阅读(4670)  评论(19编辑  收藏  举报