Imposta il testo dell elemento legenda del grafico su nessuno utilizzando Aspose.Cells
Contents
[
Hide
]
Se desideri impostare il testo del riempimento dell’elemento legenda del grafico su nessuno in modo che non venga visualizzato all’interno della legenda del grafico, imposta il LegendEntry.IsTextNoFill su true.
Il codice di esempio seguente imposta il testo del secondo riempimento dell’elemento legenda del grafico su nessuno. Scarica il file Excel di esempio utilizzato in questo codice e il file Excel di output generato da esso per ulteriori informazioni.
La seguente schermata evidenzia l’effetto di questo codice sul file excel di esempio.
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-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Open the template file. | |
Workbook workbook = new Workbook(dataDir + "Sample.xlsx"); | |
// Access the first worksheet | |
Worksheet sheet = workbook.Worksheets[0]; | |
// Access the first chart inside the sheet | |
Chart chart = sheet.Charts[0]; | |
// Set text of second legend entry fill to none | |
chart.Legend.LegendEntries[1].IsTextNoFill = true; | |
// Save the workbook in xlsx format | |
workbook.Save(dataDir + "ChartLegendEntry_out.xlsx", SaveFormat.Xlsx); |