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 Q2 2011 released 07/12/2011
select

Chart / Numerical Axis


Did you know that you can add Telerik Silverlight Charts to your ASP.NET applications?

RadControls for Silverlight


  • The numerical X axis of the chart allows setting the series items on the right location depending on their XValue property. This is especially important when the data does not come at regular basis and the chart has a time axis. DateTime values should be converted to their OLE Automation equivalents using ToOADate().
    RadChart.XAxis.Appearance.ValueFormat property provides means to format X axis labels. For the first chart is is set to ShortTime, for the second one - it is ShortDate.

Source Code

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

    <%@ Register TagPrefix="telerik" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <%@ Register TagPrefix="telerik" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="telerik" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Charting" TagPrefix="telerik" %>

    <!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 id="Head1" runat="server">
        <telerik:HeadTag runat="server" ID="Headtag1"></telerik:HeadTag>
    </head>
    <body class="BODY">
        <form id="Form1" runat="server">
            <telerik:Header ShowSkinChooser="false" runat="server" ID="Header1" NavigationLanguage="VB">
            </telerik:Header>
            <asp:ScriptManager runat="server" ID="scriptManager"></asp:ScriptManager>
            <telerik:RadChart ID="RadChart1" runat="server" Skin="Mac" Width="500" Height="300">
                <ChartTitle>
                    <TextBlock Text="Index - Today">
                    </TextBlock>
                </ChartTitle>
                <Series>
                    <telerik:ChartSeries Name="Index" Type="Area">
                        <Appearance ShowLabels="False">
                        </Appearance>
                    </telerik:ChartSeries>
                </Series>
                <Appearance TextQuality="AntiAlias" >
                </Appearance>
                <PlotArea>
                    <Appearance Dimensions-Margins="18%, 24%, 22%, 10%">
                    </Appearance>
                    <XAxis LayoutMode="Inside" AutoScale="false">
                        <Appearance ValueFormat="ShortTime" MajorGridLines-Visible="false">
                            <LabelAppearance RotationAngle="45" Position-AlignedPosition="Top">
                            </LabelAppearance>
                        </Appearance>
                    </XAxis>
                    <YAxis IsZeroBased="false">
                    </YAxis>
                </PlotArea>
            </telerik:RadChart>
            <br />
            <telerik:RadChart ID="RadChart2" runat="server" Skin="Mac" Width="500" Height="300">
                <ChartTitle>
                    <TextBlock Text="Index - Last Month">
                    </TextBlock>
                </ChartTitle>
                <Series>
                    <telerik:ChartSeries Name="Index" Type="Area">
                        <Appearance ShowLabels="False">
                        </Appearance>
                    </telerik:ChartSeries>
                </Series>
                <Appearance TextQuality="AntiAlias">
                </Appearance>
                <PlotArea>
                    <Appearance Dimensions-Margins="18%, 24%, 22%, 10%">
                    </Appearance>
                    <XAxis LayoutMode="Inside" AutoScale="false" LabelStep="5">
                        <Appearance ValueFormat="ShortDate" MajorGridLines-Visible="false">
                            <LabelAppearance RotationAngle="45" Position-AlignedPosition="Top">
                            </LabelAppearance>
                        </Appearance>
                    </XAxis>
                    <YAxis IsZeroBased="false">
                    </YAxis>
                </PlotArea>
            </telerik:RadChart>
            <telerik:Footer ShowCodeViewer="true" runat="server" ID="Footer1"></telerik:Footer>
        </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-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451