Class ChartPointCollection
Class ChartPointCollection
Namespace: Aspose.Cells.Charts
Assembly: Aspose.Cells.dll (25.2.0)
מייצג אוסף שמכיל את כל הנקודות בסדרה אחת.
public class ChartPointCollection
ירושה
חברים שהורשו
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
דוגמאות
//יצירת אובייקט Workbook
Workbook workbook = new Workbook();
//השגת הפניה לגיליון העבודה הראשון
Worksheet worksheet = workbook.Worksheets[0];
//הוספת ערך לדוגמה לתא "A1"
worksheet.Cells["A1"].PutValue(50);
//הוספת ערך לדוגמה לתא "A2"
worksheet.Cells["A2"].PutValue(100);
//הוספת ערך לדוגמה לתא "A3"
worksheet.Cells["A3"].PutValue(150);
//הוספת ערך לדוגמה לתא "B1"
worksheet.Cells["B1"].PutValue(60);
//הוספת ערך לדוגמה לתא "B2"
worksheet.Cells["B2"].PutValue(32);
//הוספת ערך לדוגמה לתא "B3"
worksheet.Cells["B3"].PutValue(50);
//הוספת גרף לגיליון העבודה
int chartIndex = worksheet.Charts.Add(ChartType.PieExploded, 5, 0, 25, 10);
//גישה לאינסטנציה של הגרף שנוסף לאחרונה
Chart chart = worksheet.Charts[chartIndex];
//הוספת NSeries (מקור נתוני הגרף) לגרף בטווח מתא "A1" עד "B3"
chart.NSeries.Add("A1:B3", true);
//הצגת תוויות נתונים
chart.NSeries[0].DataLabels.ShowValue = true;
ChartPointCollection points = chart.NSeries[0].Points;
for (int i = 0; i < points.Count; i++)
{
//השגת נקודת נתונים
ChartPoint point = points[i];
//הגדרת פיצוץ פאי
point.Explosion = 15;
//הגדרת צבע הגבול
point.Border.Color = System.Drawing.Color.Red;
}
//שמירת קובץ האקסל
workbook.Save("book1.xls");
'יצירת אובייקט Workbook
Dim workbook As Workbook = New Workbook()
'השגת הפניה לגיליון העבודה הראשון
Dim worksheet As Worksheet = workbook.Worksheets(0)
'הוספת ערך לדוגמה לתא "A1"
worksheet.Cells("A1").PutValue(50)
'הוספת ערך לדוגמה לתא "A2"
worksheet.Cells("A2").PutValue(100)
'הוספת ערך לדוגמה לתא "A3"
worksheet.Cells("A3").PutValue(150)
'הוספת ערך לדוגמה לתא "B1"
worksheet.Cells("B1").PutValue(60)
'הוספת ערך לדוגמה לתא "B2"
worksheet.Cells("B2").PutValue(32)
'הוספת ערך לדוגמה לתא "B3"
worksheet.Cells("B3").PutValue(50)
'הוספת גרף לגיליון העבודה
Dim chartIndex As Integer = worksheet.Charts.Add(ChartType.PieExploded, 5, 0, 25, 10)
'גישה לאינסטנציה של הגרף שנוסף לאחרונה
Dim chart As Chart = worksheet.Charts(chartIndex)
'הוספת NSeries (מקור נתוני הגרף) לגרף בטווח מתא "A1" עד "B3"
chart.NSeries.Add("A1:B3", True)
'הצגת תוויות נתונים
chart.NSeries(0).DataLabels.ShowValue = True
Dim points As ChartPointCollection = chart.NSeries(0).Points
For i As Integer = 0 To points.Count - 1
'השגת נקודת נתונים
Dim point As ChartPoint = points(i)
'הגדרת פיצוץ פאי
point.Explosion = 15
'הגדרת צבע הגבול
point.Border.Color = System.Drawing.Color.Red
Next i
'שמירת קובץ האקסל
workbook.Save("book1.xls")
מאפיינים
Count
משיב על כמות נקודות הגרף.
public int Count { get; }
ערך המאפיין
this[int]
משיב על אלמנט Aspose.Cells.Charts.ChartPoint באינדקס המצויין בסדרה.
public ChartPoint this[int index] { get; }
ערך המאפיין
שיטות
Clear()
מסיר את כל ההגדרות של נקודות הגרף.
public void Clear()
GetEnumerator()
מחזיר Enumerator עבור כל Aspose.Cells.Charts.ChartPointCollection.
public IEnumerator GetEnumerator()
מחזיר
RemoveAt(int)
מסיר נקודה באינדקס של הסדרה.
public void RemoveAt(int index)
פרמטרים
index
int
האינדקס של הנקודה.