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:

    2017/8/7

    2017/814

    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">
                <PlotArea>
                    <XAxis DataLabelsField="WeekDate">
                    </XAxis>
                    <YAxis Name="$">
                    </YAxis>
                    <Series>
                        <telerik:AreaSeries AxisName="$" DataFieldY="Spent" Name="Spent" Stacked="True">
                            <LabelsAppearance Visible="true" DataField="WeekDate"></LabelsAppearance>
                        </telerik:AreaSeries>
                        <telerik:AreaSeries AxisName="$" DataFieldY="Remaining" Name="Remaining" Stacked="True">
                        </telerik:AreaSeries>
                    </Series>
                </PlotArea>
            </telerik:RadHtmlChart>
  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
    Admin
    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.

     

    Regards,

    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