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
100
ColumnChart3D change X-Axis Label to display horizontally
posted

 I cant seem to figure out how to adjust the X-Axis labels to display horizontally rather than vertically. I cant even apply an angle to them. No matter what setting I try the x-axis labels never seem to move.  Here is my code snippet that applies to the x-axis.

        chart.Axis.X.Labels.Visible = false;
        chart.Axis.X.Labels.SeriesLabels.Visible = true;
        chart.Axis.X.Labels.SeriesLabels.Layout.Padding = 30;

         chart.Axis.X.Labels.SeriesLabels.Orientation = TextOrientation.Custom; (also tried TextOrientation.Horizontal)
         chart.Axis.X.Labels.SeriesLabels.OrientationAngle = 0;
         chart.Axis.X.Labels.VerticalAlign = StringAlignment.Near;

 

  • 995
    posted

    Hi,

    In some cases the Orientation settings have overrided to prevent the labels from

    colliding with each other. 

    Try to using rotate the chart or you can handle ChartDrawItem event to

    redraw the labels for a X, Y, Z axis:

    Rotating:

    this.UltraChart1.Transform3D.YRotation += 10;

    Handling ChartDrawItem;

    protected void UltraChart1_ChartDrawItem(object sender,

    Infragistics.UltraChart.Shared.Events.ChartDrawItemEventArgs e)

        {

            Text t = e.Primitive as Text;

            if (t != null && t.Path != null && t.Path.IndexOf("Grid.Y") != -1)

            {

                t.labelStyle.Orientation = TextOrientation.Horizontal;

                //t.labelStyle.RotationAngle = -90;

            }

        }