Setzen Sie den Text des Legendeneintrags des Charts auf keine Füllung mit Aspose.Cells for Node.js via C++

Contents
[ ]

Der folgende Beispielcode setzt den Text der zweiten Diagrammlegendeneintragsfüllung auf keine. Laden Sie bitte die Beispieldatei Excel herunter, die in diesem Code verwendet wird, und die Ausgabedatei Excel, die von ihr generiert wird, zur Referenz.

Das folgende Screenshot hebt die Wirkung dieses Codes auf die Beispieldatei Excel hervor.

todo:image_alt_text

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