ابحث عن نوع قيم X و Y للنقاط في سلسلة المخططات
Contents
[
Hide
]
سيناريوهات الاستخدام الممكنة
في وقت ما ، تريد معرفة نوع قيم X و Y لنقاط المخطط في سلسلة. يوفر Aspose.Cells خصائص ChartPoint.XValueType و ChartPoint.YValueType التي يمكن استخدامها لهذا الغرض. يرجى ملاحظة أنه سيتعين عليك استدعاء طريقة Chart.Calculate () قبل أن تتمكن من استخدام هذه الخصائص بفعالية.
ابحث عن نوع قيم X و Y للنقاط في سلسلة المخططات
يقوم نموذج التعليمات البرمجية التالي بتحميل ملفنموذج لملف Excel والوصول إلى المخطط الأول داخل ورقة العمل الأولى. ثم يستدعي طريقة Chart.Calculate () ويجد نوع قيم X و Y لنقطة المخطط الأولى ويطبعها على وحدة التحكم. يرجى الاطلاع على إخراج وحدة التحكم الموضح أدناه للحصول على مرجع.
عينة من الرموز
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 sample Excel file containing chart. | |
Workbook wb = new Workbook(sourceDir + "sampleFindTypeOfXandYValuesOfPointsInChartSeries.xlsx"); | |
//Access first worksheet. | |
Worksheet ws = wb.Worksheets[0]; | |
//Access first chart. | |
Chart ch = ws.Charts[0]; | |
//Calculate chart data. | |
ch.Calculate(); | |
//Access first chart point in the first series. | |
ChartPoint pnt = ch.NSeries[0].Points[0]; | |
//Print the types of X and Y values of chart point. | |
Console.WriteLine("X Value Type: " + pnt.XValueType); | |
Console.WriteLine("Y Value Type: " + pnt.YValueType); |
إخراج وحدة التحكم
X Value Type: IsString
Y Value Type: IsNumeric