更改刻度标签方向

更改刻度标签方向

Aspose.Cells 使您能够使用TickLabels.DirectionType财产。这TickLabels.DirectionType财产接受图表文本方向类型枚举值。这图表文本方向类型枚举提供以下成员

  • 水平的
  • 垂直的
  • 旋转90度
  • 旋转270
  • 堆积

下图比较了源文件和输出文件

源文件图像

待办事项:图片_替代_文本

输出文件图像

待办事项:图片_替代_文本

以下代码片段将刻度标签方向从 Rotate90 更改为 Horizontal。

示例代码

// 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");

可以从以下链接下载源文件和输出文件。

源文件

输出文件