Class DataBar
Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)
وصف قاعدة تنسيق الشرطية DataBar.
تظهر قاعدة التنسيق الشرطية هذه شريط بيانات متدرج في نطاق الخلايا.
public class DataBar
الوراثة
الأعضاء الموروثة
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 sheet = workbook.Worksheets[0];
//يضيف تنسيق شرطى فارغ
int index = sheet.ConditionalFormattings.Add();
FormatConditionCollection fcs = sheet.ConditionalFormattings[index];
//يحدد نطاق التنسيق الشرطي.
CellArea ca = new CellArea();
ca.StartRow = 0;
ca.EndRow = 2;
ca.StartColumn = 0;
ca.EndColumn = 0;
fcs.AddArea(ca);
//يضيف شرط.
int idx = fcs.AddCondition(FormatConditionType.DataBar);
fcs.AddArea(ca);
FormatCondition cond = fcs[idx];
//احصل على DataBar
DataBar dataBar = cond.DataBar;
dataBar.Color = Color.Orange;
//قم بتعيين خصائص DataBar
dataBar.MinCfvo.Type = FormatConditionValueType.Percentile;
dataBar.MinCfvo.Value = 30;
dataBar.ShowValue = false;
dataBar.BarBorder.Type = DataBarBorderType.Solid;
dataBar.BarBorder.Color = Color.Plum;
dataBar.BarFillType = DataBarFillType.Solid;
dataBar.AxisColor = Color.Red;
dataBar.AxisPosition = DataBarAxisPosition.Midpoint;
dataBar.NegativeBarFormat.ColorType = DataBarNegativeColorType.Color;
dataBar.NegativeBarFormat.Color = Color.White;
dataBar.NegativeBarFormat.BorderColorType = DataBarNegativeColorType.Color;
dataBar.NegativeBarFormat.BorderColor = Color.Yellow;
//إدخال قيم الخلايا
Aspose.Cells.Cell cell1 = sheet.Cells["A1"];
cell1.PutValue(10);
Aspose.Cells.Cell cell2 = sheet.Cells["A2"];
cell2.PutValue(120);
Aspose.Cells.Cell cell3 = sheet.Cells["A3"];
cell3.PutValue(260);
//حفظ ملف Excel
workbook.Save("book1.xlsx");
'إنشاء كائن Workbook
Dim workbook As Workbook = New Workbook()
Dim sheet As Worksheet = workbook.Worksheets(0)
'يضيف تنسيق شرطى فارغ
Dim index As Integer = sheet.ConditionalFormattings.Add()
Dim fcs As FormatConditionCollection = sheet.ConditionalFormattings(index)
'يحدد نطاق التنسيق الشرطي.
Dim ca As New CellArea()
ca.StartRow = 0
ca.EndRow = 2
ca.StartColumn = 0
ca.EndColumn = 0
fcs.AddArea(ca)
'يضيف شرط.
Dim idx As Integer = fcs.AddCondition(FormatConditionType.DataBar)
fcs.AddArea(ca)
Dim cond As FormatCondition = fcs(idx)
'احصل على DataBar
Dim dataBar As DataBar = cond.DataBar
dataBar.Color = Color.Orange
'قم بتعيين خصائص DataBar
dataBar.MinCfvo.Type = FormatConditionValueType.Percentile
dataBar.MinCfvo.Value = 30
dataBar.ShowValue = False
dataBar.BarBorder.Type = DataBarBorderType.Solid
dataBar.BarBorder.Color = Color.Plum
dataBar.BarFillType = DataBarFillType.Solid
dataBar.AxisColor = Color.Red
dataBar.AxisPosition = DataBarAxisPosition.Midpoint
dataBar.NegativeBarFormat.ColorType = DataBarNegativeColorType.Color
dataBar.NegativeBarFormat.Color = Color.White
dataBar.NegativeBarFormat.BorderColorType = DataBarNegativeColorType.Color
dataBar.NegativeBarFormat.BorderColor = Color.Yellow
'إدخال قيم الخلايا
Dim cell1 As Aspose.Cells.Cell = sheet.Cells("A1")
cell1.PutValue(10)
Dim cell2 As Aspose.Cells.Cell = sheet.Cells("A2")
cell2.PutValue(120)
Dim cell3 As Aspose.Cells.Cell = sheet.Cells("A3")
cell3.PutValue(260)
'حفظ ملف Excel
workbook.Save("book1.xlsx")
الخصائص
AxisColor
يحصل على لون المحور للخلايا التي تحتوي على تنسيق شرطي كأشرطة بيانات.
public Color AxisColor { get; set; }
قيمة الخاصية
AxisPosition
يحصل على أو يحدد موقع محور أشرطة البيانات المحددة بواسطة قاعدة تنسيق شرطية.
public DataBarAxisPosition AxisPosition { get; set; }
قيمة الخاصية
BarBorder
يحصل على كائن يحدد حد شريط البيانات.
public DataBarBorder BarBorder { get; }
قيمة الخاصية
BarFillType
يحصل على أو يحدد كيفية ملء شريط البيانات باللون.
public DataBarFillType BarFillType { get; set; }
قيمة الخاصية
Color
احصل على أو حدد لون هذه DataBar.
public Color Color { get; set; }
قيمة الخاصية
Direction
يحصل على أو يحدد الاتجاه الذي يتم عرض شريط البيانات فيه.
public TextDirectionType Direction { get; set; }
قيمة الخاصية
MaxCfvo
احصل على أو حدد كائن القيمة القصوى لهذه DataBar.
لا يمكن تعيين null أو CFValueObject من النوع FormatConditionValueType.Min له.
public ConditionalFormattingValue MaxCfvo { get; }
قيمة الخاصية
MaxLength
يمثل الطول الأقصى لشريط البيانات.
public int MaxLength { get; set; }
قيمة الخاصية
MinCfvo
احصل على أو حدد كائن القيمة الدنيا لهذه DataBar.
لا يمكن تعيين null أو CFValueObject من النوع FormatConditionValueType.Max له.
public ConditionalFormattingValue MinCfvo { get; }
قيمة الخاصية
MinLength
يمثل الطول الأدنى لشريط البيانات.
public int MinLength { get; set; }
قيمة الخاصية
NegativeBarFormat
يحصل على كائن NegativeBarFormat المرتبط بقاعدة تنسيق شرطية لشريط البيانات.
public NegativeBarFormat NegativeBarFormat { get; }
قيمة الخاصية
ShowValue
احصل على أو حدد العلامة التي تشير إلى ما إذا كان يجب عرض قيم الخلايا التي تم تطبيق هذا الشريط البيانات عليها.
القيمة الافتراضية هي true.
public bool ShowValue { get; set; }
قيمة الخاصية
الطرق
ToImage(Cell, ImageOrPrintOptions)
قم برسم شريط البيانات في الخلية إلى مصفوفة بايت الصورة.
public byte[] ToImage(Cell cell, ImageOrPrintOptions imgOpts)
المعلمات
cell
Cell
حدد شريط البيانات في أي خلية سيتم رسمه
imgOpts
ImageOrPrintOptions
تحتوي ImageOrPrintOptions على بعض خصائص الصورة الناتجة
العائدات
byte[]