This is a migrated thread and some comments may be shown as answers.

Date Issue

1 Answer 23 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Shakti SIngh Dulawat
Top achievements
Rank 1
Shakti SIngh Dulawat asked on 18 Sep 2012, 09:19 PM
Hello Friends I want to show ScannedDate at X Axis but its throwing error can any one suggest me how to show ScannedDate X Label and Name at Y Label

SELECT TOP 1000 [ShopId]
      ,[Name]
      ,[ScannedDate]
      ,[TotalSlipsScanned]
      ,[ScannedDay]
  FROM [EPOSShopScreen].[dbo].[vw_NoOfBetScanned]


<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <telerik:RadChart ID="radChartNoOfBetScanned" runat="server"
            Skin="DeepBlue" Width="900px" Height="500px"
            DataSourceID="edsNoOfBetScanned" >
            <ClientSettings EnableZoom="false" ScrollMode="XOnly" XScale="4" />
            
            <Appearance>
                <FillStyle FillType="ComplexGradient">
                    <FillSettings>
                        <ComplexGradient>
                            <telerik:GradientElement Color="26, 120, 179" />
                            <telerik:GradientElement Color="35, 189, 254" Position="0.5" />
                            <telerik:GradientElement Color="26, 120, 179" Position="1" />
                        </ComplexGradient>
                    </FillSettings>
                </FillStyle>
                <Border Color="0, 66, 110" Width="5" />
            </Appearance>
            <Series>
                <telerik:ChartSeries DataLabelsColumn="Name" DataXColumn="ScannedDay"
                    DataYColumn="TotalSlipsScanned" Name="TotalSlipsScanned">
                    <Appearance>
                        <FillStyle FillType="ComplexGradient">
                            <FillSettings>
                                <ComplexGradient>
                                    <telerik:GradientElement Color="213, 247, 255" />
                                    <telerik:GradientElement Color="193, 239, 252" Position="0.5" />
                                    <telerik:GradientElement Color="157, 217, 238" Position="1" />
                                </ComplexGradient>
                            </FillSettings>
                        </FillStyle>
                        <TextAppearance TextProperties-Color="White">
                        </TextAppearance>
                    </Appearance>
                </telerik:ChartSeries>
            </Series>
            <Legend>
                <Appearance Dimensions-Margins="1px, 2%, 12%, 1px">
                    <ItemTextAppearance TextProperties-Color="White">
                    </ItemTextAppearance>
                    <FillStyle GammaCorrection="False" MainColor="37, 255, 255, 255">
                    </FillStyle>
                    <Border Color="76, 255, 255, 255" />
                </Appearance>
                <TextBlock>
                    <Appearance Position-AlignedPosition="Top" TextProperties-Color="LightSkyBlue">
                    </Appearance>
                </TextBlock>
            </Legend>
            <PlotArea>
                <XAxis>
                    <Appearance Color="98, 183, 226" MajorTick-Color="98, 183, 226">
                        <MajorGridLines Color="98, 183, 226" Width="0" />
                        <TextAppearance TextProperties-Color="White">
                        </TextAppearance>
                    </Appearance>
                    <AxisLabel>
                        <Appearance Dimensions-Paddings="1px, 1px, 10%, 1px">
                        </Appearance>
                        <TextBlock>
                            <Appearance TextProperties-Color="LightSkyBlue">
                            </Appearance>
                        </TextBlock>
                    </AxisLabel>
                </XAxis>
                <YAxis>
                    <Appearance Color="98, 183, 226" MajorTick-Color="98, 183, 226"
                        MinorTick-Color="98, 183, 226">
                        <MajorGridLines Color="120, 209, 248" />
                        <MinorGridLines Color="120, 209, 248" Width="0" />
                        <TextAppearance TextProperties-Color="White">
                        </TextAppearance>
                    </Appearance>
                    <AxisLabel>
                        <TextBlock>
                            <Appearance TextProperties-Color="LightSkyBlue">
                            </Appearance>
                        </TextBlock>
                    </AxisLabel>
                </YAxis>
                <Appearance Dimensions-Margins="19%, 90px, 12%, 9%">
                    <FillStyle MainColor="50, 255, 255, 255" SecondColor="Transparent">
                    </FillStyle>
                    <Border Color="97, 180, 223" />
                </Appearance>
            </PlotArea>
            
            <ChartTitle>
                <Appearance Dimensions-Margins="4%, 10px, 14px, 6%">
                    <FillStyle MainColor="">
                    </FillStyle>
                </Appearance>
                <TextBlock Text="Total Slips Scanned Last 30 Days">
                    <Appearance TextProperties-Color="White" TextProperties-Font="Verdana, 14pt">
                    </Appearance>
                </TextBlock>
            </ChartTitle>
        </telerik:RadChart>
    </ContentTemplate>
</asp:UpdatePanel>
<asp:EntityDataSource ID="edsNoOfBetScanned" runat="server" ConnectionString="name=EPOSShopScreenEntities"
    DefaultContainerName="EPOSShopScreenEntities" EntitySetName="vw_NoOfBetScanned">
</asp:EntityDataSource>

1 Answer, 1 is accepted

Sort by
0
Petar Kirov
Telerik team
answered on 21 Sep 2012, 02:34 PM
Hi Shakti,

Based on the code you provided I am not sure, about the cause of the error you are getting.

I am also not sure what are the types of the columns of your table.
If ScannedDate column is of type datetime you can try converting it to OADate (double), and changing the DataXColumn from ScannedDay to ScannedDate, and setting the the format of the XAxis labels like this:
radChart.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.ShortDate;
This should be enough to show the ScannedDate for each item as an X Axis Label. As far as I can see you have managed to accomplish to bind the Name as Item Label.

If you still experience difficulties please provide more information.

Kind regards,
Petar Kirov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Chart (Obsolete)
Asked by
Shakti SIngh Dulawat
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Share this question
or