目盛りラベル方向の変更
Contents
[
Hide
]
目盛りラベル方向の変更
Aspose.Cellsは、TickLabels.DirectionTypeプロパティを使用してチャートの目盛りラベル方向を変更する機能を提供します。TickLabels.DirectionTypeプロパティは、ChartTextDirectionType列挙値を受け入れます。ChartTextDirectionType列挙は、以下のメンバーを提供します。
次の画像は、ソースファイルと出力ファイルを比較したものです。
ソースファイル画像
出力ファイル画像
次のコードスニペットは、目盛りラベルの方向をROTATE_90からHORIZONTALに変更します。
サンプルコード
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
//Source directory | |
String sourceDir = Utils.Get_SourceDirectory(); | |
//Output directory | |
String outputDir = Utils.Get_OutputDirectory(); | |
// Instantiating a Workbook object | |
Workbook workbook = new Workbook(sourceDir + "SampleChangeTickLabelDirection.xlsx"); | |
Worksheet worksheet = workbook.getWorksheets().get(0); | |
// Load the chart from source worksheet | |
Chart chart = worksheet.getCharts().get(0); | |
chart.getCategoryAxis().getTickLabels().setDirectionType(ChartTextDirectionType.HORIZONTAL); | |
// Output the file | |
workbook.save(outputDir + "outputChangeTickLabelDirection.xlsx"); |
ソースファイルと出力ファイルは、以下のリンクからダウンロードできます。