DateTime Scale auto scaling when data contains just one month

7 posts, 1 answers
  1. Scott Waye
    Scott Waye avatar
    165 posts
    Member since:
    Nov 2009

    Posted 25 Jun Link to this post

    Hi,

    Imagine the following data where the xVal just contains month start dates (1 jan, 1 feb, etc) and then give it this sample data:

    select convert(datetime, '1 mar 2018') as xVal, 1 as yVal, 'a' as seriesGrouping

    Try to place that in a bar graph so that there is a series per seriesGrouping, the x/y set as per the column names and get it to show the month of March on the x axis.  With just one data point on the x axis the autoscaling seems to think that we want 1 label per year and shows January.  When the data set has multiple months then its fine and you get labels for each month that you have data.  Is there a way to set up the x axis so that it works for the single month case, maybe with binding?

  2. Todor
    Admin
    Todor avatar
    175 posts

    Posted 28 Jun Link to this post

    Hello Scott,

    With default settings the DateTime category scale will be split in equal time-slots with minimum and maximum based on the available data (i.e. first date and last date of the period). Hence, when there is only one value - a single value will be presented on the category scale (the value from the data source).

    The Minimum and Maximum values of the Scale are customizable. In the Report designer:
    - select the corresponding Graph Axis and go to its Properties pane;
    - Expand Misc->Scale and insert the corresponding Maximum and Minimum DateTime values.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Scott Waye
    Scott Waye avatar
    165 posts
    Member since:
    Nov 2009

    Posted 28 Jun in reply to Todor Link to this post

    Thats fine, but why when the only value is 1 Mar 2018, does it display 1 Jan 2018?  And is there a way to change that without hardcoding the min/max values which will not work as the date range is supplied as report parameters?
  4. Todor
    Admin
    Todor avatar
    175 posts

    Posted 03 Jul Link to this post

    Hi Scott,

    Check the DateTime format of the data. Note that the month should be given with capital 'M', for example 'yyyy-MM-dd'. The issue was reproduced on our side when the DateTime format of the DataSource was set to 'yyyy-mm-dd'.

    The Minimum and Maximum Scale values of the graph axis can be set with Bindings to any valid Expression. You can follow the below steps in the report designer:
    1. Select the Graph and go to its Properties pane.
    2. Expand Presentation->select CoordinateSystems and click on the ellipses. The GraphCoordinateSystem Collection Editor pops up.
    3. Expand Data->select Bindings and click on the ellipses. Edit Bindings wizard pops up.
    4. Add the necessary bindings as shown in the attached screenshot.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Scott Waye
    Scott Waye avatar
    165 posts
    Member since:
    Nov 2009

    Posted 03 Jul in reply to Todor Link to this post

    Hi Todor,

    I've tried the binding and the format and it still says Jan.  I've got a sample report, but I can't attach it here.  Shall I open a ticket?  SQL for my sample report is:

    select 1  as val, convert(date, '1 jun 2018') as mon

    Then just use that as the data for a column report, with a DateTimeScale for the x axis.  My format for the label is {0:MMM yy}

    So you could probably knock the report up pretty quickly, but happy to open a ticket if you think that's best.

  6. Answer
    Todor
    Admin
    Todor avatar
    175 posts

    Posted 05 Jul Link to this post

    Hi Scott,

    This is a known issue for versions preceding Telerik Reporting R1 2018 SP2 (version 12.0.18.227).
    The problem was related to the algorithm estimating the DateTime Scale range falling back to the beginning of the year when there was only one point on the Graph.

    The issue is already fixed and I cannot reproduce it locally with our later versions.
    If you use version prior to 12.0.18.227 the option is to upgrade.

    If the version where the problem appears is newer, we would indeed need a sample report that reproduces the problem for local investigation - please, open a support ticket and attach it.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  7. Scott Waye
    Scott Waye avatar
    165 posts
    Member since:
    Nov 2009

    Posted 05 Jul in reply to Todor Link to this post

    Thanks, confirmed its fixed in later version.
Back to Top