Cell 範囲をデータ ラベルとして表示
Contents
[
Hide
]
Microsoft Excel 2013 では、データ ラベルのセル範囲を表示できます。 Aspose.Cells はこの機能をサポートしています。
Cell の範囲をデータ ラベルとして表示するためのチェックボックス
Microsoft Excel でセル範囲をデータ ラベルとして表示するには:
- 系列データ ラベルを選択し、右クリックしてコンテキスト メニューを開きます。
- 選択するデータ ラベルの書式設定.ラベル オプションが表示されます。
- オプションを選択または選択解除しますラベルの内容 - Cells からの値.
以下のサンプル コードは、チャート シリーズのデータ ラベルにアクセスし、DataLabels.ShowCellRangeプロパティへ真実を選択するラベルの内容 - Cells からの値オプション。
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-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Create workbook from the source Excel file | |
Workbook workbook = new Workbook(dataDir + "source.xlsx"); | |
// Access the first worksheet | |
Worksheet worksheet = workbook.Worksheets[0]; | |
// Access the chart inside the worksheet | |
Chart chart = worksheet.Charts[0]; | |
// Check the "Label Contains - Value From Cells" | |
DataLabels dataLabels = chart.NSeries[0].DataLabels; | |
dataLabels.ShowCellRange = true; | |
// Save the workbook | |
workbook.Save(dataDir + "output_out.xlsx"); |