This is a migrated thread and some comments may be shown as answers.

Graph with DateTime scale problem

5 Answers 159 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andrea
Top achievements
Rank 1
Veteran
Andrea asked on 21 Sep 2016, 12:50 PM

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


5 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 26 Sep 2016, 10:19 AM
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
0
Andrea
Top achievements
Rank 1
Veteran
answered on 26 Sep 2016, 01:02 PM

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

0
Accepted
Nasko
Telerik team
answered on 26 Sep 2016, 02:57 PM
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
0
Andrea
Top achievements
Rank 1
Veteran
answered on 26 Sep 2016, 09:29 PM

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.

0
Andrea
Top achievements
Rank 1
Veteran
answered on 26 Sep 2016, 09:47 PM

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

Tags
General Discussions
Asked by
Andrea
Top achievements
Rank 1
Veteran
Answers by
Nasko
Telerik team
Andrea
Top achievements
Rank 1
Veteran
Share this question
or