Date Axis not matching input

3 posts, 0 answers
  1. Alex
    Alex avatar
    48 posts
    Member since:
    Jun 2011

    Posted 15 Aug 2017 Link to this post

    Very simple case, the X-axis has dates, but the day _before_ is being shown on the access.  Date input looks like:



    But 0/6 and 8/13 are shown.  See attachment.  This happens in all cases regardless of number of records.

    <telerik:RadHtmlChart ID="burndownChart" runat="server" DataSourceID="dsBurndown" Skin="Web20">
                    <XAxis DataLabelsField="WeekDate">
                    <YAxis Name="$">
                        <telerik:AreaSeries AxisName="$" DataFieldY="Spent" Name="Spent" Stacked="True">
                            <LabelsAppearance Visible="true" DataField="WeekDate"></LabelsAppearance>
                        <telerik:AreaSeries AxisName="$" DataFieldY="Remaining" Name="Remaining" Stacked="True">
  2. Alex
    Alex avatar
    48 posts
    Member since:
    Jun 2011

    Posted 16 Aug 2017 Link to this post

    Since my inputs are single days (Mondays), I could use a workaround like the following:

    <XAxis DataLabelsField="WeekDate" Visible="True" Type="Date" BaseUnit="Days" BaseUnitStep="7" >


    However, the question still stands, how would I use the Unit of Weeks, but start on/show Monday's for the markers?  Or arbitrary day for that matter.

  3. Marin Bratanov
    Marin Bratanov avatar
    5359 posts

    Posted 23 Aug 2017 Link to this post

    Hi Alex,

    Perhaps an option is to tweak the data source provided to the chart as follows:

    • Aggregate the data according to your preferences (the chart has a default SUM aggregate for the data points in the range). Thus, you will have a single data point for the desired time period.
    • Create a string representation of the date according to your preferences, and add that to a field in the data source for the corresponding aggregated data point.
    • Provide these two fields to the chart and use a "regular" categorical axis where the chart will display your text in axis labels the data in the series without attempting date operations itself.



    Marin Bratanov
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top