Aspose.Cells for Node.js via C++ kullanarak grafikteki gösterge satırının içeriğini olmayan renge ayarlayın.
Contents
[
Hide
]
Grafik gösterge satırı içeriğinin doldurma rengini yok yapmak istiyorsanız, lütfen LegendEntry.isTextNoFill()’yi true olarak ayarlayın.
Aşağıdaki örnek kod, grafik efsanesinin ikinci giriş doldurmasını hiçbiri olarak ayarlar. Lütfen bu kodda kullanılan örnek excel dosyasını ve bununla oluşturulan çıktı excel dosyasını indirin.
Aşağıdaki ekran görüntüsü, bu kodun örnek Excel dosyası üzerindeki etkisini vurgulamaktadır.
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);