Is there a way to force the x-axis to display labels at specific interval? For example if the x-axis is a DateTime and goes from 11:23AM to 1:39PM but I only want to show labels at 11:30, 11:45, 12:00, 12:15, etc, is there a way to do this?
The CategoryXAxis wants to display a label that is associated with an actual item. What do your datetime values look like for the axis? It won't do any interpolation, and it wont make items that have timestamps with a greater difference look further apart than items with timestamps that are closer together. Your timestamps are a category label of the data, not a value to be interpolated or realigned as far as the CategoryXAxis is concerned, and are treated the same way as "Cars", "Planes", "Automobiles".
If you evenly space your timestamp values for your items, and round them, then you can adjust the interval to control which of the category labels are displayed, but it wont pick values that fall between your timestamps to make your interval an evenly rounded datetime value.
If you want some of those features you might have to start looking into the CategoryDateTimeXAxis which generates labels based on intervals in the datetime space, rather than intervals on the category index. As a result, items that have a larger delta in their time value will also look further apart than items with a smaller time delta.
The appropriate axis to choose will depend largely on what your data looks like, and what the requirements are for how the series and axes are displayed. The CategoryDateTimeXAxis was not added until later in the development cycle, so you may not have had a chance to experiment with it during the CTP.
I am trying with both but I will use whichever one will work. Converting over to the CategoryDateTimeXAxis means I have to change several pieces of code including the code to determine the y values of all the series that you send me before as the caluclated x valse looks more like a DateTime in ticks rather than a collection index.
Is there a way to make either the CategoryXAxis or CategoryDateTimeXAxis have specific label intervals and values? I need something that I can configure to display round numbers at the interval. For example, if the datetime range is 11:23:12 to 11:35:56 I would like to have lables at 11:25:00, 11:30:00 and 11:35:00. If the range was 10:34:23 to 23:43:21 then 10:00:00, 14:00:00, 18:00:00, 22:00:00, and 02:00:00. At least something like that...
Is this possible with the XamDataChart?
Mike,
Are you trying to adjust the interval for dates in the CategoryXAxis or dates in the CategoryDateTimeXAxis?
-Graham
I tried to use the Unit, minimum, and maximum properties as you mentioned but it does not appear to be exposed on the DataChart object. Does this same suggestion also hold true for the XamDataChart (I am not using the XamWebChart)? The best I can come up with is the interval property which does not guarantee my label will be on the rounded time I am hoping for.
At the moment, the way to solve this is to set the Axis.Unit to 15 minutes, then to round the Axis.Minimum value down to the nearest 15 minutes, e.g., if the x-axis needs to cover a period starting from 11:23AM, then rounding down to the nearest 15 minutes, we set the Axis.Minimum to 11:15AM. Then labels will occur at 11:15, 11:30, 11:45, etc.
Though that's not exactly the customization you described, additional customization features for things such as labels are always being considered as we plan future releases.