DataBar صف

DataBar صف

وصف قاعدة التنسيق الشرطي DataBar. تعرض قاعدة التنسيق الشرطي هذه تدرجًا شريط البيانات في نطاق الخلايا.

يكشف النوع DataBar عن الأعضاء التاليين:

ملكيات

ملكيةوصف
axis_colorيحصل على لون المحور للخلايا ذات التنسيق الشرطي كأشرطة بيانات.
axis_positionيحصل على موضع محور أشرطة البيانات المحددة بواسطة قاعدة التنسيق الشرطي أو يعينه.
bar_fill_typeيحصل على أو يعين كيفية ملء شريط البيانات باللون.
directionيحصل على أو يحدد الاتجاه الذي يظهر به شريط البيانات.
bar_borderيحصل على كائن يحدد حدود شريط البيانات.
negative_bar_formatيحصل على كائن NegativeBarFormat المرتبط بقاعدة تنسيق شرطي لشريط البيانات.
min_cfvoالحصول على أو تعيين الحد الأدنى لقيمة كائن DataBar هذا.
لا يمكن تعيين null أو CFValueObject مع نوع FormatConditionValueType.Max إليه.
max_cfvoالحصول على أو تعيين الحد الأقصى لقيمة كائن DataBar هذا.
لا يمكن تعيين null أو CFValueObject مع نوع FormatConditionValueType.Min إليه.
colorاحصل على لون شريط البيانات هذا أو قم بتعيينه.
min_lengthيمثل الحد الأدنى لطول شريط البيانات.
max_lengthيمثل الحد الأقصى لطول شريط البيانات.
show_valueاحصل على العلم الذي يشير إلى ما إذا كان سيتم عرض قيم الخلايا التي يتم تطبيق شريط البيانات هذا عليها أم لا.
القيمة الافتراضية هي true.

طُرق

طريقةوصف
to_image(self, cell, img_opts)عرض شريط البيانات في الخلية إلى مجموعة بايتات الصورة.

مثال

from aspose.cells import CellArea, DataBarAxisPosition, DataBarBorderType, DataBarFillType, DataBarNegativeColorType, FormatConditionType, FormatConditionValueType, Workbook
from aspose.pydrawing import Color

# Instantiating a Workbook object
workbook = Workbook()
sheet = workbook.worksheets[0]
# Adds an empty conditional formatting
index = sheet.conditional_formattings.add()
fcs = sheet.conditional_formattings[index]
# Sets the conditional format range.
ca = CellArea()
ca.start_row = 0
ca.end_row = 2
ca.start_column = 0
ca.end_column = 0
fcs.add_area(ca)
# Adds condition.
idx = fcs.add_condition(FormatConditionType.DATA_BAR)
fcs.add_area(ca)
cond = fcs[idx]
# Get Databar
dataBar = cond.data_bar
dataBar.color = Color.orange
# Set Databar properties
dataBar.min_cfvo.type = FormatConditionValueType.PERCENTILE
dataBar.min_cfvo.value = 30
dataBar.show_value = False
dataBar.bar_border.type = DataBarBorderType.SOLID
dataBar.bar_border.color = Color.plum
dataBar.bar_fill_type = DataBarFillType.SOLID
dataBar.axis_color = Color.red
dataBar.axis_position = DataBarAxisPosition.MIDPOINT
dataBar.negative_bar_format.color_type = DataBarNegativeColorType.COLOR
dataBar.negative_bar_format.color = Color.white
dataBar.negative_bar_format.border_color_type = DataBarNegativeColorType.COLOR
dataBar.negative_bar_format.border_color = Color.yellow
# Put Cell Values
cell1 = sheet.cells.get("A1")
cell1.put_value(10)
cell2 = sheet.cells.get("A2")
cell2.put_value(120)
cell3 = sheet.cells.get("A3")
cell3.put_value(260)
# Saving the Excel file
workbook.save("book1.xlsx")

أنظر أيضا