All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
New to Telerik UI for ASP.NET AJAX? Download free 30-day trial
The example shows how the drill down functionality of the ASP.NET AJAX Chart can be used.
On the first chart the data is grouped by the greatest time span, which is year. The year is divided into quarters. By clicking on an item on the chart you can see the values corresponding to the quarters of the selected year. Each quarter consists of 3 months. After choosing a quarter for the selected year you can see the values for each month of the this quarter.
<%@ Page Language="c#" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.Web.Examples.HtmlChart.Functionality.DrillDownChart.DefaultCS" %> <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> <!DOCTYPE html> <html xmlns='http://www.w3.org/1999/xhtml'> <head runat="server"> <title>Telerik ASP.NET Example</title> <script src="scripts.js" type="text/javascript"></script> </head> <body> <form id="form1" runat="server"> <telerik:RadScriptManager runat="server" ID="RadScriptManager1" /> <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" /> <div class="demo-container size-wide"> <telerik:RadHtmlChart ID="RadHtmlChart1" runat="server" DataSourceID="SqlDataSource1"> <ClientEvents OnSeriesClick="onSeriesClick" /> <ChartTitle Text="Revenue"> </ChartTitle> <PlotArea> <Series> <telerik:ColumnSeries DataFieldY="Rev" Name="Years"> <TooltipsAppearance Color="White" /> </telerik:ColumnSeries> </Series> <XAxis DataLabelsField="Year"> </XAxis> </PlotArea> </telerik:RadHtmlChart> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>" SelectCommand="SELECT Sum(Revenue) as Rev, Year FROM Revenue GROUP BY Year"></asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>" SelectCommand="SELECT Sum(Revenue) as Rev, Quarter FROM Revenue WHERE Year=@Year GROUP BY Quarter"> <SelectParameters> <asp:Parameter Name="Year"></asp:Parameter> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>" SelectCommand="SELECT Sum(Revenue) as Rev, Month FROM Revenue WHERE Year=@Year AND Quarter = @Quarter GROUP BY Month"> <SelectParameters> <asp:Parameter Name="Year"></asp:Parameter> <asp:Parameter Name="Quarter"></asp:Parameter> </SelectParameters> </asp:SqlDataSource> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadHtmlChart1" LoadingPanelID="LoadingPanel1"></telerik:AjaxUpdatedControl> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="Refresh"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadHtmlChart1" LoadingPanelID="LoadingPanel1"></telerik:AjaxUpdatedControl> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" Height="77px" Width="113px" runat="server"> </telerik:RadAjaxLoadingPanel> <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript"> function getAjaxManager() { return $find("<%=RadAjaxManager1.ClientID%>"); } </script> </telerik:RadCodeBlock> </div> <qsf:ConfiguratorPanel runat="server" ID="ConfiguratorPanel1"> <Views> <qsf:View> <qsf:ConfiguratorColumn ID="ConfiguratorColumn1" runat="server" Size="Medium"> <qsf:Button runat="server" ID="Refresh" Text="Restore Years Revenue Chart" OnClick="Refresh_Click"> </qsf:Button> </qsf:ConfiguratorColumn> </qsf:View> </Views> </qsf:ConfiguratorPanel> </form> </body> </html>