Visar Cell intervall som dataetiketter
Contents
[
Hide
]
I Microsoft Excel 2013 kan du visa ett cellintervall för dataetiketter. Aspose.Cells stöder den här funktionen.
Kryssa i rutan för att visa Cell intervall som dataetiketter
Så här visar du cellintervallet som dataetiketter i Microsoft Excel:
- Välj seriedataetiketterna och högerklicka för att öppna snabbmenyn.
- VäljFormatera dataetiketter. Etikettalternativ visas.
- Välj eller avmarkera alternativetEtikett innehåller - Värde från Cells.
Exempelkoden nedan ger åtkomst till en diagramseries dataetiketter och ställer inDataLabels.ShowCellRange egendom tillSann för att väljaEtikett innehåller - Värde från Cells alternativ.
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"); |