I have a time-based line series with markers turned on that has one data value per half hour in a 24 hour period starting from midnight. I have the CategoryDateTimeXAxis Interval property set to 1 hour. When I graph this, I have a nice set of hour tick labels (00:00, 01:00, 02:00, etc) but I see the markers for the first and last points in the series are cut off by the edge of the chart. I have attempted to adjust this but adding 15 minutes to the CategoryDateTimeXAxis min/max datetime values, which brings the full marker into view on the chart, but changes tick labels to 15 minute bounds (23:45, 00:45, 1:45, etc). How can I adjust the min/max just slightly to make the end point markers completely visible and NOT change the tick mark labels? There is a similar issue on the y-axis.
Attached is an example program, click the "Switch" button to adjust the chart x-axis min/max back and forth and note the x-axis label change.
Due to the way I have a CategoryXAxis and series on that axis over-laying the above CategoryDateTimeXAxis, I cannot simply shift the min/max by the interval time(1 hour), so I need a different option than that.
Thanks Andrew, your example works as indicated. I had some trouble incorporating the whole idea into my actual application as I have several series with different data interval time spans, not all are periodic, and some other series issues related to overlaying column series on the chart centered on the correct time slot. However, your suggestion of using the TimeAxisDisplayType.Discrete triggered the idea to set this flag on my main X-axis (which does not have any series associated with it, but is displayed for the tick mark labels) and then give the main X-axis a list of dates based on the "non-padded" start/end times as its item source while setting the x-axis min/max based on the "padded" start/end times.
Thanks!
Hello Gary,
Thank you for your post!
I have been investigating your sample project that you have attached, and I would recommend that you continue to add 15 minutes to the XAxis minimum and maximum value, but change the XAxis.DisplayType to TimeAxisDisplayType.Discrete. This setting draws a label for each of your data points, rather than drawing a continuous DateTime spectrum. However, this will still appear continuous in your application because of the way your data is structured.
There is a small issue that arises due to this, though. Currently, in your sample application, you are collecting data points for a 24 hour period, and are collecting a data point every half hour. The discrete DisplayType setting will draw labels for each of these half-hour intervals, which makes the label-area rather crowded and causes the labels to truncate. To fix this, I would recommend providing a data template for your Label that is essentially a TextBlock bound to Item.DatePropertyName, and setting your format on that TextBlock. Then, you can use a converter for the Visibility property of this TextBlock to determine which labels you wish to be visible. Finally, you can set this DataTemplate as your XAxis.Label property in your XamDataChart.
I have attached a modified version of the sample project you sent to demonstrate the above.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support