Class DataBar

Class DataBar

Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)

DataBar koşullu biçimlendirme kuralını tanımlayın.
Bu koşullu biçimlendirme kuralı, hücre aralığında gradyanlı bir veri çubuğu görüntüler.

public class DataBar

Miras

objectDataBar

Miras Alınan Üyeler

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Örnekler


//Bir Workbook nesnesi oluşturuluyor
Workbook workbook = new Workbook();

Worksheet sheet = workbook.Worksheets[0];

//Boş bir koşullu biçimlendirme ekler
int index = sheet.ConditionalFormattings.Add();

FormatConditionCollection fcs = sheet.ConditionalFormattings[index];

//Koşullu biçimlendirme aralığını ayarlar.
CellArea ca = new CellArea();

ca.StartRow = 0;

ca.EndRow = 2;

ca.StartColumn = 0;

ca.EndColumn = 0;

fcs.AddArea(ca);

//Koşul ekler.
int idx = fcs.AddCondition(FormatConditionType.DataBar);

fcs.AddArea(ca);

FormatCondition cond = fcs[idx];

//Databar'ı al
DataBar dataBar = cond.DataBar;

dataBar.Color = Color.Orange;

//Databar özelliklerini ayarla
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;

//Hücre Değerlerini Yerleştir
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 dosyasını kaydet
workbook.Save("book1.xlsx");

'Bir Workbook nesnesi oluşturuluyor
Dim workbook As Workbook = New Workbook()

Dim sheet As Worksheet = workbook.Worksheets(0)

'Boş bir koşullu biçimlendirme ekler
Dim index As Integer = sheet.ConditionalFormattings.Add()

Dim fcs As FormatConditionCollection = sheet.ConditionalFormattings(index)

'Koşullu biçimlendirme aralığını ayarlar.
Dim ca As New CellArea()

ca.StartRow = 0

ca.EndRow = 2

ca.StartColumn = 0

ca.EndColumn = 0

fcs.AddArea(ca)

'Koşul ekler.
Dim idx As Integer = fcs.AddCondition(FormatConditionType.DataBar)

fcs.AddArea(ca)

Dim cond As FormatCondition = fcs(idx)

'Databar al
Dim dataBar As DataBar = cond.DataBar

dataBar.Color = Color.Orange

'Databar özelliklerini ayarla
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

'Hücre Değerlerini Yerleştir
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 dosyasını kaydet
workbook.Save("book1.xlsx")

Özellikler

AxisColor

Koşullu biçimlendirme ile veri çubuğu olan hücreler için eksenin rengini alır.

public Color AxisColor { get; set; }

Özellik Değeri

Color

AxisPosition

Koşullu biçimlendirme kuralı tarafından belirtilen veri çubuklarının ekseninin konumunu alır veya ayarlar.

public DataBarAxisPosition AxisPosition { get; set; }

Özellik Değeri

DataBarAxisPosition

BarBorder

Bir veri çubuğunun sınırını belirten bir nesne alır.

public DataBarBorder BarBorder { get; }

Özellik Değeri

DataBarBorder

BarFillType

Bir veri çubuğunun nasıl renklendirileceğini alır veya ayarlar.

public DataBarFillType BarFillType { get; set; }

Özellik Değeri

DataBarFillType

Color

Bu DataBar’ın rengini alır veya ayarlar.

public Color Color { get; set; }

Özellik Değeri

Color

Direction

Databar’ın görüntülendiği yönü alır veya ayarlar.

public TextDirectionType Direction { get; set; }

Özellik Değeri

TextDirectionType

MaxCfvo

Bu DataBar’ın maksimum değer nesnesini alır veya ayarlar.
Buna null veya FormatConditionValueType.Min türünde bir CFValueObject atanamaz.

public ConditionalFormattingValue MaxCfvo { get; }

Özellik Değeri

ConditionalFormattingValue

MaxLength

Veri çubuğunun maksimum uzunluğunu temsil eder.

public int MaxLength { get; set; }

Özellik Değeri

int

MinCfvo

Bu DataBar’ın minimum değer nesnesini alır veya ayarlar.
Buna null veya FormatConditionValueType.Max türünde bir CFValueObject atanamaz.

public ConditionalFormattingValue MinCfvo { get; }

Özellik Değeri

ConditionalFormattingValue

MinLength

Veri çubuğunun minimum uzunluğunu temsil eder.

public int MinLength { get; set; }

Özellik Değeri

int

NegativeBarFormat

Bir veri çubuğu koşullu biçimlendirme kuralıyla ilişkili NegativeBarFormat nesnesini alır.

public NegativeBarFormat NegativeBarFormat { get; }

Özellik Değeri

NegativeBarFormat

ShowValue

Bu veri çubuğunun uygulandığı hücrelerin değerlerini gösterip göstermeyeceğini belirten bayrağı alır veya ayarlar.
Varsayılan değeri true’dur.

public bool ShowValue { get; set; }

Özellik Değeri

bool

Yöntemler

ToImage(Cell, ImageOrPrintOptions)

Hücredeki veri çubuğunu görüntü bayt dizisine render eder.

public byte[] ToImage(Cell cell, ImageOrPrintOptions imgOpts)

Parametreler

cell Cell

Render edilecek veri çubuğunun bulunduğu hücreyi belirtir.

imgOpts ImageOrPrintOptions

ImageOrPrintOptions, çıktı görüntüsünün bazı özelliklerini içerir.

Dönüş Değeri

byte[]

 Türkçe