Setzen Sie den Text der Eintragsfüllung der Diagrammlegende mit Aspose.Cells auf „Keine“.

Setzen Sie den Text der Eintragsfüllung der Diagrammlegende mit Aspose.Cells auf „Keine“.

Der folgende Beispielcode legt den Text der zweiten Legendeneintragsfüllung des Diagramms auf „none“ fest. Bitte laden Sie die herunterExcel-Beispieldatei in diesem Code verwendet und dieExcel-Datei ausgeben von ihm für Ihre Referenz generiert.

Der folgende Screenshot hebt die Wirkung dieses Codes hervorExcel-Beispieldatei.

todo: Bild_alt_Text

// 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(Settextofchartlegend.class);
// Open the template file.
Workbook workbook = new Workbook(dataDir + "sample.xlsx");
// Access the first worksheet
Worksheet sheet = workbook.getWorksheets().get(0);
// Access the first chart inside the sheet
Chart chart = sheet.getCharts().get(0);
// Set text of second legend entry fill to none
chart.getLegend().getLegendEntries().get(1).setTextNoFill(true);
// Save the workbook in xlsx format
workbook.save(dataDir + "output.xlsx", SaveFormat.XLSX);