اقرأ تسميات المحور بعد حساب الرسم البياني
Contents
[
Hide
]
سيناريوهات الاستخدام الممكنة
يمكنك قراءة تسميات المحور للمخطط بعد حساب قيمه باستخدامرسم بياني. احسب ()طريقة. الرجاء استخدامالمحورلهذا الغرض والتي ستعيد قائمة تسميات المحور.
اقرأ تسميات المحور بعد حساب الرسم البياني
الرجاء مراجعة نموذج التعليمات البرمجية التالي الذي يقوم بتحميل ملفنموذج لملف Excelويقرأ تسميات محور الفئات للمخطط في ورقة العمل الأولى. ثم يقوم بطباعة قيم تسميات المحور على وحدة التحكم. يرجى الاطلاع على إخراج وحدة التحكم لعينة التعليمات البرمجية الواردة أدناه كمرجع.
عينة من الرموز
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 | |
//Load the Excel file containing chart | |
Workbook wb = new Workbook("sampleReadAxisLabelsAfterCalculatingTheChart.xlsx"); | |
//Access first worksheet | |
Worksheet ws = wb.Worksheets[0]; | |
//Access the chart | |
Chart ch = ws.Charts[0]; | |
//Calculate the chart | |
ch.Calculate(); | |
//Read axis labels of category axis | |
string[] lstLabels = ch.CategoryAxis.GetAxisTexts(); | |
//Print axis labels on console | |
Console.WriteLine("Category Axis Labels: "); | |
Console.WriteLine("---------------------"); | |
//Iterate axis labels and print them one by one | |
for (int i = 0; i < lstLabels.Length; i++) | |
{ | |
Console.WriteLine(lstLabels[i]); | |
} |
إخراج وحدة التحكم
Category Axis Labels:
---------------------
Iran
China
USA
Brazil
England