Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q1 2012 released 04/11/2012
select
  • Rate / Review
    • Give your Feedback:

      Rate this demo:


Chart / AutoLayout

To test the AutoLayout capabilities on this demo:
  • AutoLayout is enabled by default -- plotArea, legend, and axis item labels are fully visible and do not overlap with one another.
  • You can hide the legend via the "Toggle Legend Visibility" button -- note how AutoLayout ensures optimal utilization of the whole chart surface so no blank space is left for the legend original position.
  • You can use the "Toggle AutoLayout" button to observe the different chart appearance with AutoLayout enabled / disabled.
Did you know that you can add Telerik Silverlight Charts to your ASP.NET applications?

RadControls for Silverlight


  • The AutoLayout functionality instructs the control to perform out-of-the-box layout arrangement that provides optimal utilization of the whole chart area and ensures that all chart elements are fully readable and do not overlap with one another.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="Chart_Examples_NewFeatures_AutoLayout_DefaultCS" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Charting" Assembly="Telerik.Web.UI" %>

    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <!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">
        <qsf:HeadTag ID="Headtag1" runat="server" />
    </head>
    <body class="BODY">
        <form id="form1" runat="server">
            <qsf:Header ShowSkinChooser="false" ID="Header1" runat="server" NavigationLanguage="c#" />
            <asp:ScriptManager ID="ScriptManager" runat="server" />
            
            <div class="bigModule">
                <div class="bigModuleBottom">
                    <div class="title">To test the AutoLayout capabilities on this demo:</div>
                    <ul>
                        <li>AutoLayout is enabled by default -- plotArea, legend, and axis item labels are fully visible and do not overlap with one another.</li>
                        <li>You can hide the legend via the "Toggle Legend Visibility" button -- note how AutoLayout ensures optimal utilization of the whole chart surface so no blank space is left for the legend original position.</li>
                        <li>You can use the "Toggle AutoLayout" button to observe the different chart appearance with AutoLayout enabled / disabled.</li>
                    </ul>
                </div>
            </div>
            <div class="module">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <div style="margin-bottom: 15px;">
    <asp:Button ID="Button1" runat="server" Text="Toggle AutoLayout" CssClass="qsfButtonBig"
    OnClick="Button1_Click" />

    <asp:Button ID="Button2" runat="server" Text="Toggle Legend Visibility" CssClass="qsfButtonBig"
    OnClick="Button2_Click" />

                    </div>
                    <telerik:RadChart ID="RadChart1" runat="server" DataSourceID="SqlDataSource1"
                        Skin="WebBlue" AutoLayout="true" Height="350px" Width="680px" SeriesOrientation="Horizontal">
                        <Series>
                            <telerik:ChartSeries DataYColumn="UnitPrice" Name="Product Unit Price">
                            </telerik:ChartSeries>
                        </Series>
                        <PlotArea>
                            <XAxis DataLabelsColumn="TenMostExpensiveProducts">
                            </XAxis>
                        </PlotArea>
                        <ChartTitle>
                            <TextBlock Text="Ten Most Expensive Products" />
                        </ChartTitle>
                    </telerik:RadChart>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
                    SelectCommand="Ten Most Expensive Products" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
                </ContentTemplate>
            </asp:UpdatePanel>
            </div>
            <qsf:Footer runat="server" ID="Footer1" ShowCodeViewer="true" />
        </form>
    </body>
    </html>

Get more than expected!

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2012 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451