目盛りラベル方向の変更

目盛りラベル方向の変更

Aspose.Cellsでは、TickLabels.DirectionTypeプロパティを使用してチャートの目盛りラベルの方向を変更する機能が提供されます。TickLabels.DirectionTypeプロパティはChartTextDirectionType列挙値を受け入れます。ChartTextDirectionType列挙は以下のメンバーを提供します。

- 水平 - 垂直 - Rotate90 - Rotate270 - スタック

次の画像は、ソースファイルと出力ファイルを比較したものです。

ソースファイル画像

todo:image_alt_text

出力ファイル画像

todo:image_alt_text

次のコードスニペットは、Rotate90から水平への目盛りラベルの方向を変更します。

サンプルコード

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

ソースファイルと出力ファイルは、以下のリンクからダウンロードできます。

ソースファイル

出力ファイル