Mostrando el rango Cell como las etiquetas de datos
Contents
[
Hide
]
En Microsoft Excel 2013, puede mostrar un rango de celdas para las etiquetas de datos. Aspose.Cells admite esta función.
Casilla de verificación para mostrar el rango Cell como etiquetas de datos
Para mostrar el rango de celdas como etiquetas de datos en Microsoft Excel:
- Seleccione las etiquetas de datos de la serie y haga clic con el botón derecho para abrir el menú contextual.
- SeleccioneEtiquetas de datos de formato. Se muestran las opciones de etiqueta.
- Seleccione o borre la opciónLa etiqueta contiene: valor desde Cells.
El código de muestra a continuación accede a las etiquetas de datos de una serie de gráficos y establece elDataLabels.ShowCellRange propiedad averdadero para seleccionar elLa etiqueta contiene: valor desde Cells opción.
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"); |