Disabilita il rientro del testo per le etichette dei dati del grafico
Microsoft Excel 2013 consente agli utenti di abilitare o disabilitare il testo all’interno delle etichette dati del grafico. Per impostazione predefinita, il testo all’interno delle etichette dati del grafico è nello stato di testo a capo.
Aspose.Cells fornisce una proprietà DataLabels.IsTextWrapped che è possibile impostare su True o False per abilitare o disabilitare il testo a capo delle etichette dati rispettivamente.
Il campione di codice sottostante mostra come disabilitare il testo a capo per le etichette dati del grafico.
// 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); | |
// Load the sample Excel file inside the workbook object | |
Workbook workbook = new Workbook(dataDir + "sample.xlsx"); | |
// Access the first worksheet | |
Worksheet worksheet = workbook.Worksheets[0]; | |
// Access the first chart inside the worksheet | |
Chart chart = worksheet.Charts[0]; | |
// Disable the Text Wrapping of Data Labels in all Series | |
chart.NSeries[0].DataLabels.IsTextWrapped = false; | |
chart.NSeries[1].DataLabels.IsTextWrapped = false; | |
chart.NSeries[2].DataLabels.IsTextWrapped = false; | |
// Save the workbook | |
workbook.Save(dataDir + "Output_out.xlsx"); |