Change Tick Label Direction

Change Tick Label Direction

Aspose.Cells provides you with the ability to change the chart tick label direction by using the TickLabels.DirectionType property. The TickLabels.DirectionType property accepts the ChartTextDirectionType enumeration value. The ChartTextDirectionType enumeration provides the following members

  • Horizontal
  • Vertical
  • Rotate90
  • Rotate270
  • Stacked

The following image compares the source and output files

Source file image

todo:image_alt_text

Output file image

todo:image_alt_text

The following code snippet changes the tick label direction from Rotate90 to Horizontal.

Sample Code

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
Workbook workbook = new Workbook(sourceDir + "SampleChangeTickLabelDirection.xlsx");
Worksheet worksheet = workbook.Worksheets[0];
// Load the chart from source worksheet
Chart chart = worksheet.Charts[0];
chart.CategoryAxis.TickLabels.DirectionType = ChartTextDirectionType.Horizontal;
// Output the file
workbook.Save(outputDir + "outputChangeChartDataLableDirection.xlsx");

The source and output files can be downloaded from the following links.

Source File

Output File