Hello!
I have 2 questions on the DataChart labels and axis.
1. How does LabelSettings.Extent for the NumericXAxis work? I am using the trick to format the labels using the DataTempate with the TextBlock and Converter. I set the extent to some specific value, like 45, but instead of spanning 45 pixels, it starts creating empty space underneath, so there is a big margin at the bottom of the chart. Sometimes it does make the next labels go to the 2nd and 3rd line, like this:
label1 label4 label2 label5 label3 label6
but it doesn't happen always, and I don't seem to be able to control this behaviour. So how can I make it so that the labels width are fixed, and if needed they go to several lines?
2. The chart always starts with the tick, so the 1st and the last points are squeezed to the chart border. Is there a way to add a padding without ruining the chart grid? I tried decreasing min and increasing max limits on the x-axis, and it does create some padding between the points and the borders, but then the grid is not aligned with the points anymore. Is there a way to do this?
I can provide screenshots if needed.
Thanks in advance!
Hi.
What behavior would you like when you increase the extent? Bigger labels? Aligned in the middle? There is a property for affective their vertical alignement. The staggering behavior is initiated if the labels would have collided. They form as many rows as there is space allowed for to avoid intersecting.
There is currently no way to add margins around the displayed data without manually setting up the axis ranges. Which you can do with the numeric axes but not with the CategoryXaxis.
Hope this helps!
-Graham
I understand about the margins, thanks.
As for the labels: I know how to middle-align them to tick marks. The problem is that staggering doesn't happen always. Maybe the problem is that I'm using a DataTemplated TextBlock as a label (as per the blog entry on how to format DateTime labels) -- does the extent work in this case? Or should this be controlled by the TextBlock? Or both?