Cell 範囲をデータ ラベルとして表示
Contents
[
Hide
]
MS Excel でセル範囲をデータ ラベルとして表示する
Microsoft Excel 2013 では、データ ラベルの Cell 範囲を表示できます。このオプションを選択するには、次の手順に従います
- シリーズのデータ ラベルを選択し、右クリックしてポップアップ メニューを開きます。
- クリックデータ ラベルの書式設定…そしてそれは表示されますラベル オプション.
- チェックボックスをオンまたはオフにするラベルの内容 - Cells からの値.
Cell 範囲をデータ ラベルとして表示するためのチェックボックス
次のスクリーンショットは、参考のためにこのオプションを強調しています。
セル範囲を Aspose.Cells のデータ ラベルとして表示する
Aspose.Cells はDataLabels.setShowCellRange()チェックボックスをオンまたはオフにするメソッドラベルの内容 - Cells からの値上のスクリーンショットに示すように。
Java セル範囲をデータ ラベルとして表示するコード
以下のサンプル コードは、チャート シリーズのデータ ラベルにアクセスし、設定します。DataLabels.setShowCellRange()チェックするメソッドを true にするラベルの内容 - Cells からの値オプション。
This file contains hidden or 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 | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(ShowCellRangeAsTheDataLabels.class); | |
// Create workbook from the source Excel file | |
Workbook workbook = new Workbook(dataDir + "sample.xlsx"); | |
// Access the first worksheet | |
Worksheet worksheet = workbook.getWorksheets().get(0); | |
// Access the chart inside the worksheet | |
Chart chart = worksheet.getCharts().get(0); | |
// Check the "Label Contains - Value From Cells" | |
DataLabels dataLabels = chart.getNSeries().get(0).getDataLabels(); | |
dataLabels.setShowCellRange(true); | |
// Save the workbook | |
workbook.save(dataDir + "output.xlsx"); | |