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
2009
Clipping of Text labels not working as expected in 3D chart
posted

Hi,

 I have a SatckedColumn chart which can be seen in 2D or 3D. I have used ClipTextAxisLabelLayoutBehavior behavior to make series label clipped. It is working as expected in 2D chart but in 3D, it is colliding with the legend.

I have attached both the 2D and 3D charts. The code I am using is:

myInfraChart.ChartType = ChartType.StackColumnChart;

NumericSeries num1Series = new NumericSeries();
num1Series.Points.Add(new NumericDataPoint(Convert.ToDouble(10), "Alice 123456123456123456123456123456123456123456123456", false));
num1Series.Points.Add(new NumericDataPoint(Convert.ToDouble(20), "Bob 123456123456123456123456123456123456123456123456", false));
num1Series.Points.Add(new NumericDataPoint(Convert.ToDouble(30), "Carol", false));
num1Series.Label = "Characters that are huge but very lovely and Characters that are huge but very lovely again!";
myInfraChart.Series.Add(num1Series);

ClipTextAxisLabelLayoutBehavior alb = new ClipTextAxisLabelLayoutBehavior();
alb.ClipText = true;
alb.Enabled = true;
alb.EnableRollback = false;
alb.HideText = false;
alb.Trimming = StringTrimming.EllipsisCharacter;
alb.UseOnlyToPreventCollisions = false;

myInfraChart.Axis.X.Labels.SeriesLabels.Layout.Behavior = AxisLabelLayoutBehaviors.UseCollection;
myInfraChart.Axis.X.Labels.SeriesLabels.Layout.BehaviorCollection.Clear();
myInfraChart.Axis.X.Labels.SeriesLabels.Layout.BehaviorCollection.Add(alb);

myInfraChart.Legend.Visible = true;
myInfraChart.Legend.Location = LegendLocation.Bottom;

 

Please let me know what I may be missing.

Thanks.

StackedColumn.zip