قراءة مخططات Excel 2016 والتعامل معها
Contents
[
Hide
]
سيناريوهات الاستخدام الممكنة
يدعم Aspose.Cells الآن قراءة ومعالجة Microsoft مخططات Excel 2016 غير الموجودة في Microsoft Excel 2013 أو الإصدارات السابقة.
قراءة مخططات Excel 2016 والتعامل معها
يقوم نموذج التعليمات البرمجية التالي بتحميل ملفملف اكسل المصدرالذي يحتوي على مخططات Excel 2016 في ورقة العمل الأولى. يقرأ جميع المخططات واحدًا تلو الآخر ويغير عنوانه وفقًا لنوع الرسم البياني الخاص به. تُظهر لقطة الشاشة التالية ملف 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 | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Load source excel file containing excel 2016 charts | |
Workbook book = new Workbook(dataDir + "excel2016Charts.xlsx"); | |
// Access the first worksheet which contains the charts | |
Worksheet sheet = book.Worksheets[0]; | |
// Access all charts one by one and read their types | |
for (int i = 0; i < sheet.Charts.Count; i++) | |
{ | |
// Access the chart | |
Chart ch = sheet.Charts[i]; | |
// Print chart type | |
Console.WriteLine(ch.Type); | |
// Change the title of the charts as per their types | |
ch.Title.Text = "Chart Type is " + ch.Type.ToString(); | |
} | |
// Save the workbook | |
book.Save(dataDir + "out_excel2016Charts.xlsx"); |
إخراج وحدة التحكم
هنا هو إخراج وحدة التحكم من نموذج التعليمات البرمجية أعلاه عند تنفيذه مع المقدمةملف اكسل المصدر.
Waterfall
Treemap
Sunburst
Histogram
BoxWhisker