⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 drilldownotherelement.aspx

📁 掌握学习.net开发的非常好的资料
💻 ASPX
字号:
<%@ Page Language="C#" Debug="false" Trace="false" Description="dotnetCHARTING Component"%>
<%@ Register TagPrefix="dotnet"  Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%>
<%@ Import Namespace="System.Drawing" %>


<script runat="server">
void Page_Load(Object sender,EventArgs e)
{
	

	if(!IsPostBack)
    {
    	DropDownLimitMode.Items.Add("Top");
        DropDownLimitMode.Items.Add("Bottom");
		DropDownLimitMode.Items.Add("ExcludeTop");
		DropDownLimitMode.Items.Add("ExcludeBottom");
		if(Request.QueryString["limitMode"]!=null)
			DropDownLimitMode.SelectedIndex =  (int)Enum.Parse(typeof(dotnetCHARTING.LimitMode),Request.QueryString["limitMode"],true);
    }
    
   

	//set global properties
	Chart.Title="Sales";
    Chart.ChartArea.YAxis.Label.Text="Sales";
    Chart.ChartArea.YAxis.FormatString="Currency";
    Chart.TempDirectory="temp";
    Chart.Debug=true;
    Chart.DefaultSeries.DefaultElement.Transparency=15;
    Chart.Use3D=true;
    Chart.Size="500x450";
    Chart.TitleBox.Position=TitleBoxPosition.FullWithLegend;

    //Add a series
    Chart.Series.ConnectionString = @"../../database/chartsample.mdb";
    Chart.Series.StartDate=new System.DateTime(2002,1,1,0,0,0);
    Chart.Series.EndDate = new System.DateTime(2002,12,31,23,59,59);
    Chart.Series.Name="Sales";
    Chart.Series.SqlStatement= @"SELECT Name,Sum(Quantity) FROM Orders WHERE OrderDate >= #STARTDATE# AND OrderDate <= #ENDDATE#  GROUP BY Orders.Name ORDER BY Sum(Quantity) DESC";
    Chart.SeriesCollection.Add();

    



//This is the same chart with the ShowOther property set
//this will add an element representing the total sales
//for other customers not in the top five.

    //set global properties
    Chart2.Title="Sales";
    Chart2.ChartArea.YAxis.Label.Text="Sales";
    Chart2.ChartArea.YAxis.FormatString="Currency";
    Chart2.TempDirectory="temp";
    Chart2.Debug=true;
    Chart2.DefaultSeries.DefaultElement.Transparency=15;
    Chart2.Use3D=true;
    //"OtherAll", shows all other elements in the second level.
    //"Other" shows the next number of elements has been set in limit propertes.
    Chart2.DrillDownChain="other"; 
    Chart2.Series.DefaultElement.ToolTip="%yvalue";
    Chart2.Size="500x450";
    Chart2.TitleBox.Position=TitleBoxPosition.FullWithLegend;
    Chart2.YAxis.SmartScaleBreak = true;





    //Add a series
    Chart2.Series.ConnectionString = @"../../database/chartsample.mdb";
    Chart2.Series.StartDate=new System.DateTime(2002,1,1,0,0,0);
    Chart2.Series.EndDate = new System.DateTime(2002,12,31,23,59,59);
    Chart2.Series.Name="Sales";
    Chart2.Series.SqlStatement= @"SELECT Name,Sum(Quantity) FROM Orders WHERE OrderDate >= #STARTDATE# AND OrderDate <= #ENDDATE#  GROUP BY Orders.Name  ORDER BY Sum(Quantity) DESC";
    Chart2.Series.Limit=TextBoxLimit.Text;       
	Chart2.Series.LimitMode = (dotnetCHARTING.LimitMode)Enum.Parse(typeof(dotnetCHARTING.LimitMode),DropDownLimitMode.SelectedItem.Value,true);
	Chart2.Series.ShowOther=true;
    Chart2.Series.OtherElementText ="Other";
    Chart2.SeriesCollection.Add();
    
       
}
void ButtonSet_Click(object sender, EventArgs e) 
{


}
</script>
<HTML><HEAD><TITLE>Drill down on other element</TITLE></HEAD>
<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
    <form runat="server">
        <div align="center">
            <table border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber1">
                <tbody>
                <tr>
    <td width="1%">
<img border="0" src="../../images/dotnetCharting.gif" width="230" height="94"></td>
    <td width="99%" bgcolor="#BFC0DB">Limit: 
    
 <ASP:DropDownList id="DropDownLimitMode" runat="server" size="1">
    </ASP:DropDownList>
    <ASP:TextBox id="TextBoxLimit" runat="server" size="5"/>
     <asp:Button id="ButtonSet" OnClick="ButtonSet_Click" runat="server" Text="Set">
    </asp:Button>
 </td>
          </tbody>
            </table>
            </form>
 
<DIV align=center>
 <table>
<tbody>
<tr>
<td>
 <dotnet:Chart id="Chart"  runat="server"/>
 </td><td>
 <dotnet:Chart id="Chart2"  runat="server"/>
</td>
</tr>
</tbody>
</table>
 
</DIV>
</BODY>
</HTML>

⌨️ 快捷键说明

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