Plot DateTime axis with milliseconds

1 Answer 26 Views
Converters DataSources Graph
Antonino
Top achievements
Rank 1
Iron
Antonino asked on 12 Aug 2022, 02:57 PM

Hi,

I have a set of data with a timestamp that changes with the order of milliseconds. I would like to add in my report a Line chart (or similar) showing the data as a function of the timestime. Unfortunately it appears that the LineChart allows you to lower the base unit only to seconds and not milliseconds. 

Is there any way to force the millisecond time?

As a workaround I tried two things:

First, to plot the data adding as cathegories the milliseconds, seconds, minutes, and h of the data. It works, but to be honest is not very pretty (see Img0.png)

Alternatively, I also tried to generate a Calculated field where I substract the Timestamp of the data with the First Timestamp, in order to have a time that starts from 0. From this Field, I wanted to manually calculate the milliseconds (adding also seconds, minutes, etc) in order to make a Scatter graph. However the obtained field has some issues. In the dataSource it appears as date, showing it has Minute, Second, etc, but if I try to refer to these subfields it gives me errors. I attached two pictures, one with the error shown if I just make a preview of the two data calculated, the other showing the Calculated Field (note that for the second one I'm simply collecting the Millisecond field). 

Could you please help me with this, maybe with an example? thank you in advance! 

Keep in mind that I would prefer to resolve it within Telerik, without the need to use outside code/calculations.

 

Dimitar
Telerik team
commented on 17 Aug 2022, 09:26 AM

Indeed, the DateTime scale doesn't allow setting a base unit of Milliseconds, you may make a feature request about it - Progress® Telerik® Reporting Feedback Portal.

The error from Img1 suggests that it cannot access the field or that field's object does not have a property named Milliseconds. I know that you would prefer not to use outside code but for this case, I believe that the best solution would be to invoke a user function that will return the Mlliseconds value - User Functions

Alternatively, you could test using the built AddMilliseconds(date, milliseconds) Date and Time Function for any calculations that you perform(it should also work with negative values so that is how you may subtract).

If you need further assistance, please attach the report alongside the data necessary to preview it so that I could try to create a solution.

1 Answer, 1 is accepted

Sort by
0
Accepted
Antonino
Top achievements
Rank 1
Iron
answered on 13 Sep 2022, 06:57 AM

Thank you Dimitar for you comment. 

At the end I was able to plot it by creating a calculated field where I substract the TotalMillisecond Field of the first Timestamp from all the other Timestamps, and I used this field as X axis for a scatter plot. 

= CInt(Fields.Timestamp.TimeOfDay.TotalMilliseconds- Fields.StartTimestamp.TimeOfDay.TotalMilliseconds)

 

 

Tags
Converters DataSources Graph
Asked by
Antonino
Top achievements
Rank 1
Iron
Answers by
Antonino
Top achievements
Rank 1
Iron
Share this question
or