Visualizzazione dell'intervallo Cell come etichette dati
Contents
[
Hide
]
In Microsoft Excel 2013 è possibile visualizzare un intervallo di celle per le etichette dei dati. Aspose.Cells supporta questa funzione.
Casella di controllo per mostrare l’intervallo Cell come etichette dati
Per mostrare l’intervallo di celle come etichette dati in Microsoft Excel:
- Seleziona le etichette dei dati della serie e fai clic con il pulsante destro del mouse per aprire il menu di scelta rapida.
- SelezionareFormato etichette dati. Vengono visualizzate le opzioni dell’etichetta.
- Selezionare o deselezionare l’opzioneL’etichetta contiene - Valore da Cells.
Il codice di esempio riportato di seguito accede alle etichette dei dati di una serie di grafici e imposta il fileDataLabels.ShowCellRange proprietà aVERO per selezionare ilL’etichetta contiene - Valore da Cells opzione.
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); | |
// Create workbook from the source Excel file | |
Workbook workbook = new Workbook(dataDir + "source.xlsx"); | |
// Access the first worksheet | |
Worksheet worksheet = workbook.Worksheets[0]; | |
// Access the chart inside the worksheet | |
Chart chart = worksheet.Charts[0]; | |
// Check the "Label Contains - Value From Cells" | |
DataLabels dataLabels = chart.NSeries[0].DataLabels; | |
dataLabels.ShowCellRange = true; | |
// Save the workbook | |
workbook.Save(dataDir + "output_out.xlsx"); |