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 WrapTextAxisLabelLayoutBehaviorwraptext.enabled = truewraptext.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
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 = UseCollectionAlso, it wouldn't hurt to set EnableRollback to false on the wrap text behavior itself.
Max,
I'm using the following code but my labels are not wrapping. I tried typing what you had into the vb.net area but it didn't accept "wraptext" as an option to add to the collection. What am I doing wrong?
Bill
<Labels Font="Verdana, 7pt" HorizontalAlign="Near" ItemFormatString="none" Orientation="VerticalLeftFacing" VerticalAlign="Center" Visible="False"> <SeriesLabels Font="Verdana, 12pt, style=Bold" HorizontalAlign="Center" Orientation="Custom" VerticalAlign="Center" OrientationAngle="45"> <Layout Behavior="UseCollection"> <BehaviorCollection> <igchartprop:WrapTextAxisLabelLayoutBehavior UseOnlyToPreventCollisions="False" EnableRollback="False" /> <igchartprop:StaggerAxisLabelLayoutBehavior /> </BehaviorCollection> </Layout> </SeriesLabels> </Labels>
Did you define wraptext? The first post in this thread does this, so i didn't bother doing so in my reply.
Dim wraptext As New WrapTextAxisLabelLayoutBehaviorwraptext.enabled = truewraptext.UseOnlyToPreventCollisions = FalseUltraChart1.Axis.X.Labels.SeriesLabels.Layout.BehaviorCollection.Add(wraptext)UltraChart1.Axis.X.Labels.SeriesLabels.Layout.Behavior = UseCollection