Trouble in adding a Label to X Axix...?

Thread is closed for posting
2 posts, 0 answers
  1. Dane
    Dane avatar
    4 posts
    Member since:
    Feb 2009

    Posted 26 Feb 2009 Link to this post

    When I add a label to X axix of my bar chart it only shows few x axix values, records doesn't show correctly. When I remove the label it shows all the X axix values, but then there is no x axix label to denote what is x axix means.
    This may be a stupid mistake I'm doing... Following is my ASP.NET page... why all of records in my table doesn't display...?

    <radc:RadChart ID="RadChartq" runat="server" Margins-Bottom="125px" Margins-Left="10%" 
                        Margins-Right="10%" Width="800px" Palette="Gradient" Height="500px"
                            <VerticalGridlines Visible="False" /> 
                            <HorizontalGridlines Color="DarkGray" /> 
                        <YAxis MaxValue="65"
                            <Label ShadowColor="180, 0, 0, 0" TextFont="Arial, 10pt"
                        <XAxis AutoScale="False" DataLabelsColumn="hour_start" MaxItemsCount="24" LabelRotationAngle="-70" 
                            <Label ShadowColor="180, 0, 0, 0" TextFont="Arial, 10pt"
                        <Legend VAlignment="Top" VSpacing="40"
                            <Background BorderColor="144, 144, 144" FillStyle="Solid" MainColor="White" /> 
                        <Background BorderColor="Gray" FillStyle="Gradient" MainColor="Silver" SecondColor="White" 
                            BorderWidth="1" Corners-RoundSize="6" /> 
                        <PlotArea BorderColor="" Corners-BottomLeft="Round" Corners-BottomRight="Round" Corners-RoundSize="6" 
                            Corners-TopLeft="Round" Corners-TopRight="Round" /> 
                        <ChartTitle HorPadding="10" HSpacing="10" ShadowColor="180, 0, 0, 0" TextColor="White" 
                            TextFont="Arial, 16px" > 
                            <Background FillStyle="Solid" /> 
                        <EmptySeriesMessage ShadowColor="180, 0, 0, 0" TextColor="Red" TextFont="Arial, 12pt"

    Code Behind..
    DataSet dsData = new WebServices().METHOD(); 
                Font labelFont = new Font("Arial", 9, GraphicsUnit.Pixel); 
                ChartSeries Series1 = this.RadChart1.CreateSeries("TITLE..", Color.Empty, ChartSeriesType.Bar); 
                Series1.LabelAppearance.TextColor = Color.DarkSlateGray; 
                Series1.LabelAppearance.Alignment = ContentAlignment.TopCenter; 
                Series1.LabelAppearance.TextFont = labelFont; 
                Series1.LabelAppearance.RotationAngle = -90; 
                Series1.LabelAppearance.VerPadding = 5; 
                Series1.LineWidth = 2; 
                Series1.MainColor = Color.Green; 
                foreach (DataRow row in dsData.Tables[0].Rows) 
                    ChartSeriesItem item = new ChartSeriesItem(); 
                    item.XValue = ((DateTime)row["hour_start"]).ToLocalTime().ToOADate(); 
                    item.YValue = Convert.ToDouble(row["ROWS"]); 
    I need to display the label in date time format.  My table has only two columns, ROWS, and hour_start Appreciate help..
  2. Vladimir Milev
    Vladimir Milev avatar
    1061 posts

    Posted 02 Mar 2009 Link to this post

    Hello Dane,

    I have prepared a small example project for you to demonstrate the basic functionality of adding custom XAxis labels manually. It seems to be working fine. Can you please take a look? It may be what you are after.

    Vladimir Milev
Back to Top