Cell 範囲をデータ ラベルとして表示

Cell の範囲をデータ ラベルとして表示するためのチェックボックス

Microsoft Excel でセル範囲をデータ ラベルとして表示するには:

  1. 系列データ ラベルを選択し、右クリックしてコンテキスト メニューを開きます。
  2. 選択するデータ ラベルの書式設定.ラベル オプションが表示されます。
  3. オプションを選択または選択解除しますラベルの内容 - Cells からの値.

以下のサンプル コードは、チャート シリーズのデータ ラベルにアクセスし、DataLabels.ShowCellRangeプロパティへ真実を選択するラベルの内容 - Cells からの値オプション。

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