Chart alignment text direction

Hi everybody,


I would like my chart axis text to be horizontal but I can’t find the property in Aspose. Could someone help me ?

Thanks in advance !

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

Please try the following properties to control the text rotation, alignment and direction of chart’s axis

For X-Axis

  1. chart.CategoryAxis.Title.RotationAngle
  2. chart.CategoryAxis.Title.TextDirection
  3. chart.CategoryAxis.Title.TextHorizontalAlignment
  4. chart.CategoryAxis.Title.TextVerticalAlignment

For Y-Axis
  1. chart.ValueAxis.Title.RotationAngle
  2. chart.ValueAxis.Title.TextDirection
  3. chart.ValueAxis.Title.TextHorizontalAlignment
  4. chart.ValueAxis.Title.TextVerticalAlignment

Thanks for your response but I can’t set these properties neither in chart.CategoryAxis nor in chart.ValueAxis… I just see these properties in serie.DataLabels, but it does not interrest myself.

Hi,


Please try using the following attributes of TickLabels:

For X-Axis
  1. chart.CategoryAxis.TickLabels.RotationAngle
  2. chart.CategoryAxis.TickLabels.TextDirection


For Y-Axis
  1. chart.ValueAxis.TickLabels.RotationAngle
  2. chart.ValueAxis.TickLabels.TextDirection

Hi,

Thanks for your input.

You are right. These properties actually exist in Title property of the Category and Value axis.

I have fixed them in the above post.

For X-Axis

  1. chart.CategoryAxis.Title.RotationAngle
  2. chart.CategoryAxis.Title.TextDirection
  3. chart.CategoryAxis.Title.TextHorizontalAlignment
  4. chart.CategoryAxis.Title.TextVerticalAlignment

For Y-Axis
  1. chart.ValueAxis.Title.RotationAngle
  2. chart.ValueAxis.Title.TextDirection
  3. chart.ValueAxis.Title.TextHorizontalAlignment
  4. chart.ValueAxis.Title.TextVerticalAlignment

Thanks all for your answers.

In fact, I did the good way but not at the good moment. These properties must be setted after the series of chart have been !
Because if you set the text direction of axis, and then the series, text directions are moved.

Hi,


It looks that you have sorted out every thing for now.

Feel free to contact us any time if you need further help or have more queries/issues, we will be happy to assist you.

Thank you.