Graph with DateTime scale problem

6 posts, 1 answers
  1. Andrea
    Andrea avatar
    9 posts
    Member since:
    Jan 2014

    Posted 21 Sep Link to this post

    Hi,
    I'm using telerik reporting Q3 2013 sp1 (7.2.14.127) in winform application.
    In my report i have a graph control with DateTime scale and month unit:

    dateTimeScale1.BaseUnit = Telerik.Reporting.DateTimeScaleUnits.Months;
    dateTimeScale1.LabelUnit = Telerik.Reporting.DateTimeScaleUnits.Months;
    dateTimeScale1.MajorUnit = Telerik.Reporting.DateTimeScaleUnits.Months;
    dateTimeScale1.MinorUnit = Telerik.Reporting.DateTimeScaleUnits.Months;
    dateTimeScale1.PositionMode = Telerik.Reporting.AxisPositionMode.OnTicks;

    and labels format:

    this.graphAxis2.LabelFormat = "{0: MMM yy}";
    this.graphAxis2.LabelPlacement = Telerik.Reporting.GraphAxisLabelPlacement.NextToAxis;

    Graph was shown, but datetime scale is not corrert, it's shifted back of one month,
    for example if date is 14/10/2015
    in graph the label date is "sept 2015" instead of "oct 2015".

    Graph datasource in the attached image is:

    l.Add(new GraphSerie { Data = Convert.ToDateTime("14/10/2015"), Serie = "Andamento cellule", Valore = 100 });
    l.Add(new GraphSerie { Data = Convert.ToDateTime("8/11/2015"), Serie = "Andamento cellule", Valore = 150 });
    l.Add(new GraphSerie { Data = Convert.ToDateTime("22/12/2015"), Serie = "Andamento cellule", Valore = 130 });
    l.Add(new GraphSerie { Data = Convert.ToDateTime("18/01/2016"), Serie = "Andamento cellule", Valore = 256 });
    l.Add(new GraphSerie { Data = Convert.ToDateTime("4/02/2016"), Serie = "Andamento cellule", Valore = 500 });
    l.Add(new GraphSerie { Data = Convert.ToDateTime("15/03/2016"), Serie = "Andamento cellule", Valore = 0 });
    l.Add(new GraphSerie { Data = Convert.ToDateTime("16/04/2016"), Serie = "Andamento cellule", Valore = 600 });
    l.Add(new GraphSerie { Data = Convert.ToDateTime("27/05/2016"), Serie = "Andamento cellule", Valore = 199 });
    l.Add(new GraphSerie { Data = Convert.ToDateTime("14/06/2016"), Serie = "Andamento cellule", Valore = 247 });
    l.Add(new GraphSerie { Data = Convert.ToDateTime("19/07/2016"), Serie = "Andamento cellule", Valore = 445 });
    l.Add(new GraphSerie { Data = Convert.ToDateTime("14/10/2015"), Serie = "Soglia", Valore = 150 });
    l.Add(new GraphSerie { Data = Convert.ToDateTime("19/07/2016"), Serie = "Soglia", Valore = 150 });

    As you can see all dates in graph labels are shifted back of one month.

    Where could be the problem?

    Thank you very much.
    Andrea


  2. Nasko
    Admin
    Nasko avatar
    909 posts

    Posted 26 Sep Link to this post

    Hello Andrea,

    We tested the Graph item with the provided sample data and this screenshot shows the end result. The result is achieved with the latest version of Telerik Reporting (R3 2016) where the described issue is not present. Our suggestion is to upgrade to the latest version in order to resolve the issue.

    Attached you can find the sample report used for the test.

    Regards,
    Nasko
    Telerik by Progress
    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. DevCraft banner
  4. Andrea
    Andrea avatar
    9 posts
    Member since:
    Jan 2014

    Posted 26 Sep in reply to Nasko Link to this post

    Thank you.

    Is DateTime scale that have a bug or this problem is generated my configuration of category/groups or something else?

    To workaround this bug is possibile to use a numeric property (and so use numeric scale) for x axis and

    use another object property (string type) to display x axis label? (like DataMember an DisplayMember in Windows form controls)

    Thank you very much. Regards.

    Andrea

  5. Answer
    Nasko
    Admin
    Nasko avatar
    909 posts

    Posted 26 Sep Link to this post

    Hello Andrea,

    This issue is a bug which has been fixed in the latest version.

    To work around this bug it is possible to replace the DateTime scale with a Category scale. This will allow you to format the date and display it as a string on the X axis.

    Regards,
    Nasko
    Telerik by Progress
    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
  6. Andrea
    Andrea avatar
    9 posts
    Member since:
    Jan 2014

    Posted 26 Sep in reply to Nasko Link to this post

    Hi,

    I change scale to category scale and format the Date to string in category label format but the graph not show the line with data point, and the two series appear not overlying but in sequence.

    I don't understant where is the problem, do you can send me a c# project sample with a datasource similar at my datasource written in my first post please? I would really appreciate it.

    Thank you very much.

  7. Andrea
    Andrea avatar
    9 posts
    Member since:
    Jan 2014

    Posted 26 Sep in reply to Andrea Link to this post

    Sorry,

    I fix my problem,

    the problem was that i specified field name in the Series x filed.

    If i leave blank this field graph work fine.

    Thank you very much for helping me

    Andrea

Back to Top
DevCraft banner