orders3.aspx

来自「掌握学习.net开发的非常好的资料」· ASPX 代码 · 共 49 行

ASPX
49
字号
<%@ Page Language="VB" Description="dotnetCHARTING Component"%>
<%@ Register TagPrefix="dotnet"  Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%>
<%@ Import Namespace="System.Drawing" %>


<script runat="server">
Sub Page_Load(sender As Object,e As EventArgs )

	'set global properties
    Chart.DefaultSeries.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;user id=admin;password=;data source=" & Server.MapPath("../../database/chartsample.mdb")  
    Chart.XAxis.Label.Text="Customers"
    Chart.TempDirectory="temp"
    Chart.Debug=true
    Chart.ChartArea.Shadow.Depth=10
    Chart.TitleBox.IconPath="icon.gif"
    
    'you can set the size by 2 ways: using Size property or Height and Width properties.
    'Chart.Size="500x640"
    Chart.Height= Unit.Parse(500)
    Chart.Width= Unit.Parse(640)


    
    'set backgrounds 
    Chart.ChartArea.Background = new Background("background.gif",BackgroundMode.ImageStretch)   
    Chart.Background = new Background(System.Drawing.Color.LightBlue)
    Chart.TitleBox.Background = new Background(System.Drawing.Color.FromArgb(38,98,103))
    Chart.LegendBox.Background = new Background(System.Drawing.Color.FromArgb(38,98,103))
    
    Chart.TitleBox.Label =  new dotnetCHARTING.Label("Orders By Customers",new Font("Arial",10),Color.FromArgb(36,209,224))
    Chart.LegendBox.Label = new dotnetCHARTING.Label("",new Font("Arial",10),Color.FromArgb(36,209,224))

    
    
    'Add a series
    Chart.Series.Name="Orders"
    Chart.Series.SqlStatement= "SELECT Name,Sum(1) FROM Orders GROUP BY Name ORDER BY Sum(1) DESC"
    Chart.SeriesCollection.Add()
    
End Sub
</script>
<HTML><HEAD><TITLE>Orders Report</TITLE></HEAD>
<BODY>
<DIV align=center>
 <dotnet:Chart id="Chart"  runat="server"/>
</DIV>
</BODY>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?