asp.net微软图表控件使用示例代码分享

复制代码 代码如下:


<configuration>
  <system.webServer>
    <handlers>
      <remove />
      <add preCondition="integratedMode" verb="GET,HEAD,POST"
        path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    </handlers>
  </system.webServer>
  <system.web>
    <httpHandlers>
      <add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        validate="false" />
    </httpHandlers>
  </system.web>
</configuration>

复制代码 代码如下:


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="chart.aspx.cs" Inherits="chart" %>

<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>

<!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>MsChart图表控件</title>
</head>
<body>
    <form runat="server">
    <div>
        <asp:Chart runat="server" BorderDashStyle="Solid" Palette="BrightPastel" imagetype="Png"  BackSecondaryColor="White" BackGradientStyle="TopBottom" BorderWidth="2" backcolor="#D3DFF0" BorderColor="26, 59, 105">
            <Titles>
                <asp:Title Font="微软雅黑, 16pt" Text="统计表">
                </asp:Title>
            </Titles>
            <borderskin skinstyle="Emboss"></borderskin>
            <Series>
                <asp:Series  ChartType="Bubble" MarkerSize="8" MarkerStyle="Circle">
                </asp:Series>
            </Series>
            <ChartAreas>
                <asp:ChartArea  BorderColor="64, 64, 64, 64" BackSecondaryColor="Transparent" BackColor="64, 165, 191, 228" ShadowColor="Transparent" BackGradientStyle="TopBottom">
                </asp:ChartArea>
            </ChartAreas>
        </asp:Chart> 

        <asp:Chart runat="server">
            <Series>
                <asp:Series>
                </asp:Series>
            </Series>
            <ChartAreas>
                <asp:ChartArea>
                </asp:ChartArea>
            </ChartAreas>
        </asp:Chart>
        <br/>

<asp:Chart runat="server">
            <Series>
                <asp:Series>
                </asp:Series>
            </Series>
            <ChartAreas>
                <asp:ChartArea>
                </asp:ChartArea>
            </ChartAreas>
        </asp:Chart>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wjzpfp.html