Hi,
I have a StackBarChart and the Y axis are long (approx 50 characters). I have used WrapTextAxisLabelLayoutBehavior to wrap the Y axis labels over two lines.
The problem I have is that the labels are clipped at the top and bottom. Is it possible to change the height of a label?
Any help greatly appreciated.
Regards
James O'Doherty
I wonder if you need to increase chart.Axis.Y.Extent to accomodate the extra space. You might also want to try setting EnableRollback to false on your layout behavior. Can you provide a screenshot?
Hi Max,
Thanks for the reply.
Here's a screenshot.
Here's the code
.Axis.Y.Labels.SeriesLabels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.Horizontal .Axis.Y.Labels.SeriesLabels.HorizontalAlign = StringAlignment.Far .Axis.Y.Labels.SeriesLabels.VerticalAlign = StringAlignment.Center .Axis.Y.Labels.SeriesLabels.Layout.Behavior = Infragistics.UltraChart.Shared.Styles.AxisLabelLayoutBehaviors.UseCollection Dim behavior = New Infragistics.UltraChart.Resources.Appearance.WrapTextAxisLabelLayoutBehavior() behavior.Enabled = True behavior.EnableRollback = False behavior.UseOnlyToPreventCollisions = False .Axis.Y.Labels.SeriesLabels.Layout.BehaviorCollection.Add(behavior) .Axis.X.Extent = 30 .Axis.Y.Extent = 120
This appears to be a problem when the series labels are horizontally oriented and there's a wrap behavior defined. However, you can implement a quick fix by handling the chart's FillSceneGraph event:Private Sub UltraChart1_FillSceneGraph(ByVal sender As System.Object, ByVal e As FillSceneGraphEventArgs) Handles UltraChart1.FillSceneGraph For Each p As Primitive In e.SceneGraph If TypeOf (p) Is Text Then Dim label As Text = CType(p, Text) If label.Path Is Nothing Then Return If label.Path.IndexOf("Border.Title.Grid.Y") = -1 Then Return label.bounds.Height = 40 End If NextEnd Sub
Hi Max
Works great. You guys are awesome.
Cheers
James