Dates are out of order on chart


https://www.nevron.com/Forum/Topic7365.aspx
Print Topic | Close Window

By Bob Smith - 11 Years Ago
I have a stepped line chart that plots points according to their value on the y axis and their date on the x axis.

For some reason the date 1/10/2013 is being drawn to the chart *before* 1/1/2013...

Also, I would *like* to set the X axis as a date range and not just the dates from the data points. I don't know how to modify the X axis to represent a range of dates.

I've attached a screenshot of the issue.
By Nevron Support - 11 Years Ago

Hi Bob,

This may be an issue with the values and the corresponding date time – actually the grouping.

You can try to add Sorting in the Pivot >> Data Groupings >>  Categories >> Sorting. Something like:
Expression: =Fields!Time_Stamp.Value
Direction: Ascending

Let us know if this helps.

PS - there was no screenshot with your post, please try to attach it again.

By Bob Smith - 11 Years Ago
Appears that sorting has no impact whatsoever. Apparently datetime values are evaluated differently than I thought...

I'm getting the following error message for .jpg, .JPEG and PNG files:

One of the files you have attempted to attach to this post is not a permitted MIME type.

What is the permitted file type for screenshots?
By Bob Smith - 11 Years Ago
Ok, I solved it.

The solution was this:

=DATETIME(Fields!Date)
Sort: Ascending

I guess it wasn't looking at the "DateTime" values as "DateTime" values until I put them in that expression. Looks like it works!
By Bob Smith - 11 Years Ago
I think GIF files can get through. Attachments are a little silly at this point, but it may help someone else who uses this topic as a reference.

The picture quality is pretty bad, but I think it demonstrates the issue just fine.
By Nevron Support - 11 Years Ago

Most likely this is because the data in "Date" field is not recognized as DateTime values. Probably you have an Excel spreadsheet and use the Excel Services connection. By using the DATETIME function you should be able to convert to DateTime value. The date time is parsed according to the specified culture. If culture is not specified the value is parsed with the current thread culture. Check out the DateTime.TryParse documentation in MSDN for a complete discussion.

Regarding setting the X axis as range of dates, can you please elaborate.
The following KB topic describes how you can filter the chart based on a begin and end date: http://support.nevron.com/KB/a206/filter-the-chart-web-part-based-on-begin-and-end-date.aspx

 

By Bob Smith - 11 Years Ago
To elaborate on setting the X axis as a range of dates see the last post in the following thread:

http://forum.nevron.com/shwmessage.aspx?ForumID=13&MessageID=7362

This resolved the issue that I was having