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...?
Code Behind..
I need to display the label in date time format. My table has only two columns, ROWS, and hour_start Appreciate help..
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"> |
| <Gridlines> |
| <VerticalGridlines Visible="False" /> |
| <HorizontalGridlines Color="DarkGray" /> |
| </Gridlines> |
| <YAxis MaxValue="65"> |
| <Label ShadowColor="180, 0, 0, 0" TextFont="Arial, 10pt"> |
| </Label> |
| </YAxis> |
| <XAxis AutoScale="False" DataLabelsColumn="hour_start" MaxItemsCount="24" LabelRotationAngle="-70" |
| ValueFormat="ShortTime"> |
| <Label ShadowColor="180, 0, 0, 0" TextFont="Arial, 10pt"> |
| </Label> |
| </XAxis> |
| <Legend VAlignment="Top" VSpacing="40"> |
| <Background BorderColor="144, 144, 144" FillStyle="Solid" MainColor="White" /> |
| </Legend> |
| <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" /> |
| </ChartTitle> |
| <EmptySeriesMessage ShadowColor="180, 0, 0, 0" TextColor="Red" TextFont="Arial, 12pt"> |
| </EmptySeriesMessage> |
| </radc:RadChart> |
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"]); |
| Series1.Items.Add(item); |
| } |