Grafik lejant giriş dolgu metnini Aspose.Cells kullanarak hiçbir şeye ayarlayın
Contents
[
Hide
]
Grafiğin lejant giriş dolgu metnini hiçbir şey olarak ayarlamak istiyorsanız böylece grafiğin lejant içinde görüntülenmemesi için lütfen LegendEntry.IsTextNoFill’i true olarak ayarlayın.
Grafik lejant giriş dolgu metnini hiçbir şeye ayarlayın using Aspose.Cells
Aşağıdaki örnek kod, grafiğin ikinci lejant giriş dolgusunu hiçbir metne ayarlar. Lütfen bu kodda kullanılan örnek excel dosyasını indirin ve bu kod tarafından oluşturulan çıktı excel dosyasını referansınız için indirin.
Aşağıdaki ekran görüntüsü bu kodun örnek excel dosyası üzerindeki etkisini vurgulamaktadır.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |