zoukankan      html  css  js  c++  java
  • Owc的使用自己封装好的类可以实现14种分析图

     

    一、图形类型列表

    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

  • 相关阅读:
    json
    [题解]luogu_P2151_HH去散步(矩阵floyd
    [题解]数字计数(数位dp(模板向
    【简单计数知识】JZOJ6395. 【NOIP2019模拟2019.10.28】消失的序列
    字符云例子
    JAVA FileUtils(文件读写以及操作工具类)
    AT2657 Mole and Abandoned Mine
    Problem: [Usaco2018 Open]Team Tic Tac Toe
    Problem: [USACO2018 Jan]Blocked Billboard II
    算法——星星树
  • 原文地址:https://www.cnblogs.com/xh831213/p/401461.html
Copyright © 2011-2022 走看看