马克兑换人民币汇率:Owc的使用---自己封装好的类可以实现14种分析图

来源:百度文库 编辑:九乡新闻网 时间:2024/04/27 21:12:52

一、图形类型列表

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文件

         

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