Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
375
Two axis questions
posted

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!

Parents
  • 30692
    Suggested Answer
    Offline posted

    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

Reply Children