How can one avoid drawing the xaxis labels that are displayed on the left/right bounds of the XamDataChart? The leftmost one ends up being covered by the legend and the rightmost one is cut off by the chart bounds. Hopefully these images will illustrate what I mean.
Left side:
Right side:
Regards,
Matt
Ah, yes, forgot we were talking about WPF. Yes, ClipToBounds is simpler.
-Graham
Matt, you could probably also do some advanced things by providing a data template to define the labels on the x axis. If the controls in the label could check how their bounds align with their containing chart (TransformToVisual helps here), they could determine if they should alter their rendering to say, collapse or shorten the text and introduce an ellipsis.
The current functionality will auto-stagger or auto-ellipsis the labels if they collide with each other, but the current assumption is that you might want the outliers to spill out of the chart's area, unless otherwise clipped.
I ended up doing as Graham suggested - clipping the chart. This works pretty well. A simple ClipToBounds="True" does the trick.
Hi,
Currently, the best way to achieve this is to put more margin around the chart to give the labels room to draw. Alternatively, you can put the chart in a container and assign some clip geometry (Clip property) to make sure the labels are clipped rather than extending outside the chart.
If you would like specific advanced axis labels features please make a feature request and describe your scenario and we can try to accomodate.
Hope this helps! Let me know if you want some more specific guidance.