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
20
Orientation Angle for Custom Labels
posted

Morning,

 I am using a BarChart and everything is just about right except for the X Axis label orientation. I am using a custom array that I pass in at run time via:

_ultraChart.Data.SetRowLabels(this.GetColumnLabels(_data));

GetColumnLabels loops through a generic collection to generate a string array.

This is all working well and good but when I attempt to set the orientation angle, the labels remain horizontal. I am trying to have them at a 45 deg angle:

_ultraChart.Axis.X.Labels.Orientation = TextOrientation.Custom;
_ultraChart.Axis.X.Labels.OrientationAngle = 45;

This is obviously only being applied to the default values that are being assigned to the X Axis because when I toggle the X axis on and off, those values are shown at the proper angle.

 My question is .... Is there a OrientationAngle property that I can set somewhere that will apply to the labels that are shown using the SetLabels method? Do I need to apply something in a rendering event somewhere?

 

 

 

 

  • 26458
    Offline posted

    If you're using a BarChart, your row and column labels are displayed on the Y axis and data values are displayed on the X axis. Setting row labels also means that you're setting 'series labels' (column labels are item labels, row labels are series labels).

    So, if you are using a BarChart, set ultrachart.Axis.Y.Labels.SeriesLabels.Orientation and OrientationAngle.
    If you're using a ColumnChart, use ultrachart.Axis.X.Labels.SeriesLabels.Orientation and OrientationAngle.