Class DataBar
Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)
데이터 바 조건부 서식 규칙을 설명합니다.
이 조건부 서식 규칙은 셀 범위에 그라데이션 데이터 바를 표시합니다.
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 = cond.DataBar;
dataBar.Color = Color.Orange;
//데이터 바 속성 설정
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)
'데이터 바 가져오기
Dim dataBar As DataBar = cond.DataBar
dataBar.Color = Color.Orange
'데이터 바 속성 설정
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
이 데이터 바의 색상을 가져오거나 설정합니다.
public Color Color { get; set; }
속성 값
Direction
데이터 바가 표시되는 방향을 가져오거나 설정합니다.
public TextDirectionType Direction { get; set; }
속성 값
MaxCfvo
이 데이터 바의 최대 값 객체를 가져오거나 설정합니다.
null 또는 FormatConditionValueType.Min 유형의 CFValueObject를 설정할 수 없습니다.
public ConditionalFormattingValue MaxCfvo { get; }
속성 값
MaxLength
데이터 바의 최대 길이를 나타냅니다.
public int MaxLength { get; set; }
속성 값
MinCfvo
이 데이터 바의 최소 값 객체를 가져오거나 설정합니다.
null 또는 FormatConditionValueType.Max 유형의 CFValueObject를 설정할 수 없습니다.
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[]