チャート凡例のエントリの塗りつぶしを「なし」に設定する方法(Aspose.Cells for Node.js via C++使用)
Contents
[
Hide
]
チャートの凡例エントリの塗りつぶしを「なし」に設定して、凡例内に表示されないようにする場合は、LegendEntry.isTextNoFill()をtrueに設定してください。
次のサンプルコードは、チャートの2番目の凡例エントリの塗りつぶしのテキストを無効に設定します。このコードで使用される サンプルExcelファイル とその生成される 出力Excelファイル をダウンロードして参照してください。
次のスクリーンショットは、このコードがsample excel fileに与える影響を示しています。
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
// Open the template file.
const workbook = new AsposeCells.Workbook(path.join(dataDir, "Sample.xlsx"));
// Access the first worksheet
const sheet = workbook.getWorksheets().get(0);
// Access the first chart inside the sheet
const chart = sheet.getCharts().get(0);
// Set text of second legend entry fill to none
chart.getLegend().getLegendEntries().get(1).setIsTextNoFill(true);
// Save the workbook in xlsx format
workbook.save(path.join(dataDir, "ChartLegendEntry_out.xlsx"), AsposeCells.SaveFormat.Xlsx);