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
870
Wrap Text Behavior on x axis of column chart does not work
posted

I am trying to get the x axis labels to wrap on a column chart (part of a composite chart) and the following does not work:

Dim wraptext As New WrapTextAxisLabelLayoutBehavior
wraptext.enabled = true
wraptext.UseOnlyToPreventCollisions = False
.AxisX.Labels.Layout.BehaviorCollection.Add(wraptext)
.AxisX.Labels.Layout.Behavior = AxisLabelLayoutBehaviors.UseCollection

This is the result:

What am I doing wrong?

Thanks,

Dana

Parents
  • 26458
    Offline posted

    Looks like you're using series labels on your chart, so you should be setting the wrap text behavior to the seres labels, instead of item labels:

    Axis.X.Labels.SeriesLabels.Layout.BehaviorCollection.Add(wraptext)
    Axis.X.Labels.SeriesLabels.Layout.Behavior = UseCollection

    Also, it wouldn't hurt to set EnableRollback to false on the wrap text behavior itself.

Reply Children