X Axis Date format hours

2 posts, 0 answers
  1. Thomas Cornelio
    Thomas Cornelio avatar
    5 posts
    Member since:
    Feb 2010

    Posted 11 Jul 2014 Link to this post

    Hi,

    I am testing the RadHtmlCharts and so far so good.

    However, on the X axis i would like to show the hour in the format e.g. 01:00 - 02:00 rather than just showing 01:00 e.g.

    Could someone please advise how i can accomplish this.

    Attached please find the example chart i am currently using.

    Thanks

    Tommy
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 11 Jul 2014 in reply to Thomas Cornelio Link to this post

    Hi Thomas Cornelio,

    Please try the below approach to achieve your scenario. Here I am binding RadHtmlChart using SqlDataSource and in table the x value column I am saving it as "98-99" format.

    ASPX:
    <telerik:RadHtmlChart runat="server" Width="800px" Height="500px" ID="RadHtmlChart1"
        DataSourceID="SqlDataSource1">
        <PlotArea>
            <Series>
                <telerik:ColumnSeries DataFieldY="Value" Name="Electricity Consumption">
                    <TooltipsAppearance Color="White" />
                </telerik:ColumnSeries>
            </Series>
            <XAxis DataLabelsField="Year">
                <LabelsAppearance RotationAngle="75">
                </LabelsAppearance>
                <TitleAppearance Text="Year">
                </TitleAppearance>
            </XAxis>
            <YAxis>
                <TitleAppearance Text="MWh">
                </TitleAppearance>
            </YAxis>
        </PlotArea>
        <Legend>
            <Appearance Visible="false">
            </Appearance>
        </Legend>
        <ChartTitle Text="Electricity Consumption">
        </ChartTitle>
    </telerik:RadHtmlChart>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top