zoukankan      html  css  js  c++  java
  • ASP.NET 2.0轻松搞定统计图表(二)

    前台代码:

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="OWCdrawing.aspx.cs"

    Inherits="OWCdrawing" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >

    <head runat="server">

    <title>清清月儿</title>

    </head>

    <body>

    <form id="form1" runat="server">

    <div>

    <table style=" 600px">

    <tr>

    <td colspan="3" style="height: 20px">

    <strong>怎么样在ASP.NET2.0中使用OWC组件画图</strong></td>

    </tr>

    <tr>

    <td colspan="3" rowspan="2" style="height: 21px">

    <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>

    </td>

    </tr>

    <tr>

    </tr>

    </table>    

    </div>

    </form>

    </body>

    </html>

    数据库SQL脚本:

    USE [web]

    GO

    /****** 对象:   Table [dbo].[Chart] ******/

    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条数据,手动添加,最终结果类似下图:

    ASP.NET 2.0轻松搞定统计图表(图四)
    图4

    后台程序说明:

    最关键就是InsertChart.Type = ChartChartTypeEnum.chChartTypeColumnClustered;

    你可以在ChartChartTypeEnum后点出其他方法。如图所示:

    ASP.NET 2.0轻松搞定统计图表(图五)
    图5

    下面列出的是其他类型图:

    折线图:

    ASP.NET 2.0轻松搞定统计图表(图六)
    图5

    面积图:

    ASP.NET 2.0轻松搞定统计图表(图七)
    图5

    条形图:

    ASP.NET 2.0轻松搞定统计图表(图九)
    图4

    OWC什么图形都可以画,还能画立体的,请大家自己尝试。

  • 相关阅读:
    像asp.net Mvc一样开发nodejs+express Mvc站点
    js数组方法大全
    自己的时间规划
    7月暑假生活总结
    01. What Is Discrete Mathematics(中英字幕 by Ocean-藏心)
    找工作专题---二分查找
    angular.js 入门基础
    WCF实例管理
    是技术牛人,如何拿到国内IT巨头的Offer
    python
  • 原文地址:https://www.cnblogs.com/zjoch/p/1965846.html
Copyright © 2011-2022 走看看