Aspose::Cells::IDataBar Class Referenceabstract

Describe the DataBar conditional formatting rule. This conditional formatting rule displays a gradated data bar in the range of cells. More...

Inherits Object.

Public Member Functions

virtual intrusive_ptr< Aspose::Cells::Systems::Drawing::Color > GetAxisColor ()=0
 Gets the color of the axis for cells with conditional formatting as data bars. More...
 
virtual void SetAxisColor (intrusive_ptr< Aspose::Cells::Systems::Drawing::Color > value)=0
 Sets the color of the axis for cells with conditional formatting as data bars. More...
 
virtual Aspose::Cells::DataBarAxisPosition GetAxisPosition ()=0
 Gets the position of the axis of the data bars specified by a conditional formatting rule. More...
 
virtual void SetAxisPosition (Aspose::Cells::DataBarAxisPosition value)=0
 Sets the position of the axis of the data bars specified by a conditional formatting rule. More...
 
virtual Aspose::Cells::DataBarFillType GetBarFillType ()=0
 Gets how a data bar is filled with color. More...
 
virtual void SetBarFillType (Aspose::Cells::DataBarFillType value)=0
 Sets how a data bar is filled with color. More...
 
virtual Aspose::Cells::TextDirectionType GetDirection ()=0
 Gets the direction the databar is displayed. More...
 
virtual void SetDirection (Aspose::Cells::TextDirectionType value)=0
 Sets the direction the databar is displayed. More...
 
virtual intrusive_ptr< Aspose::Cells::IDataBarBorderGetIBarBorder ()=0
 Gets an object that specifies the border of a data bar. More...
 
virtual intrusive_ptr< Aspose::Cells::INegativeBarFormatGetINegativeBarFormat ()=0
 Gets the NegativeBarFormat object associated with a data bar conditional formatting rule. More...
 
virtual intrusive_ptr< Aspose::Cells::IConditionalFormattingValueGetMinICfvo ()=0
 Gets this DataBar's min value object. Cannot set null or CFValueObject with type FormatConditionValueType.Max to it. More...
 
virtual intrusive_ptr< Aspose::Cells::IConditionalFormattingValueGetMaxICfvo ()=0
 Gets this DataBar's max value object. Cannot set null or CFValueObject with type FormatConditionValueType.Min to it. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Drawing::Color > GetColor ()=0
 Gets this DataBar's Color. More...
 
virtual void SetColor (intrusive_ptr< Aspose::Cells::Systems::Drawing::Color > value)=0
 Sets this DataBar's Color. More...
 
virtual Aspose::Cells::Systems::Int32 GetMinLength ()=0
 Represents the min length of data bar . More...
 
virtual void SetMinLength (Aspose::Cells::Systems::Int32 value)=0
 Represents the min length of data bar . More...
 
virtual Aspose::Cells::Systems::Int32 GetMaxLength ()=0
 Represents the max length of data bar . More...
 
virtual void SetMaxLength (Aspose::Cells::Systems::Int32 value)=0
 Represents the max length of data bar . More...
 
virtual bool GetShowValue ()=0
 Get the flag indicating whether to show the values of the cells on which this data bar is applied. Default value is true. More...
 
virtual void SetShowValue (bool value)=0
 Set the flag indicating whether to show the values of the cells on which this data bar is applied. Default value is true. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::Systems::Byte > > ToImage (intrusive_ptr< Aspose::Cells::ICell > cell, intrusive_ptr< Aspose::Cells::Rendering::IImageOrPrintOptions > imgOpts)=0
 Render data bar in cell to image byte array. More...
 

Detailed Description

Describe the DataBar conditional formatting rule. This conditional formatting rule displays a gradated data bar in the range of cells.

[C++]
//Instantiating a Workbook object
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook();
intrusive_ptr<IWorksheet> sheet = workbook->GetIWorksheets()->GetObjectByIndex(0);
<br>//Adds an empty conditional formatting
int index = sheet->GetIConditionalFormattings()->Add();
intrusive_ptr<IFormatConditionCollection> fcs = sheet->GetIConditionalFormattings()->GetObjectByIndex(index);
<br>//Sets the conditional format range.
intrusive_ptr<ICellArea> ca = Factory::CreateICellArea();
ca->SetstartRow(0);
<br>ca->SetendRow(2);
<br>ca->SetstartColumn(0);
<br>ca->SetendColumn(0);
<br>fcs->AddArea(ca);
<br>//Adds condition.
int idx = fcs->AddCondition(FormatConditionType::FormatConditionType_DataBar);
fcs->AddArea(ca);
<br>intrusive_ptr<IFormatCondition> cond = fcs->GetObjectByIndex(idx);
<br>//Get Databar
intrusive_ptr<IDataBar> dataBar = cond->GetIDataBar();
<br>dataBar->SetColor(Color::GetOrange());
<br>//Set Databar properties
dataBar->GetMinICfvo()->SetType(FormatConditionValueType::FormatConditionValueType_Percentile);
<br>Int32 n = 30;
ObjectPtr obj = NEW Primitive<Int32>(n);
dataBar->GetMinICfvo()->SetValue(obj);
dataBar->SetShowValue(false);
dataBar->GetIBarBorder()->SetType(DataBarBorderType::DataBarBorderType_DataBarBorderSolid);
<br>dataBar->GetIBarBorder()->SetColor(Color::GetPlum());
<br>dataBar->SetBarFillType(DataBarFillType::DataBarFillType_DataBarFillSolid);
<br>dataBar->SetAxisColor(Color::GetRed());
dataBar->SetAxisPosition(DataBarAxisPosition::DataBarAxisPosition_DataBarAxisMidpoint);
<br>dataBar->GetINegativeBarFormat()->SetColorType(DataBarNegativeColorType::DataBarNegativeColorType_DataBarColor);
<br>dataBar->GetINegativeBarFormat()->SetColor(Color::GetWhite());
<br>dataBar->GetINegativeBarFormat()->SetBorderColorType(DataBarNegativeColorType::DataBarNegativeColorType_DataBarColor);
<br>dataBar->GetINegativeBarFormat()->SetBorderColor(Color::GetYellow());
<br>//Put Cell Values
intrusive_ptr<ICell> cell1 = sheet->GetICells()->GetObjectByIndex(new String("A1"));
<br>cell1->PutValue(10);
intrusive_ptr<ICell> cell2 = sheet->GetICells()->GetObjectByIndex(new String("A2"));
cell2->PutValue(120);
intrusive_ptr<ICell> cell3 = sheet->GetICells()->GetObjectByIndex(new String("A3"));
cell3->PutValue(260);
//Saving the Excel file
workbook->Save(new String("D:\\book1.xlsx"));

Member Function Documentation

◆ GetAxisColor()

virtual intrusive_ptr<Aspose::Cells::Systems::Drawing::Color> Aspose::Cells::IDataBar::GetAxisColor ( )
pure virtual

Gets the color of the axis for cells with conditional formatting as data bars.

◆ GetAxisPosition()

virtual Aspose::Cells::DataBarAxisPosition Aspose::Cells::IDataBar::GetAxisPosition ( )
pure virtual

Gets the position of the axis of the data bars specified by a conditional formatting rule.

◆ GetBarFillType()

virtual Aspose::Cells::DataBarFillType Aspose::Cells::IDataBar::GetBarFillType ( )
pure virtual

Gets how a data bar is filled with color.

◆ GetColor()

virtual intrusive_ptr<Aspose::Cells::Systems::Drawing::Color> Aspose::Cells::IDataBar::GetColor ( )
pure virtual

Gets this DataBar's Color.

◆ GetDirection()

virtual Aspose::Cells::TextDirectionType Aspose::Cells::IDataBar::GetDirection ( )
pure virtual

Gets the direction the databar is displayed.

◆ GetIBarBorder()

virtual intrusive_ptr<Aspose::Cells::IDataBarBorder> Aspose::Cells::IDataBar::GetIBarBorder ( )
pure virtual

Gets an object that specifies the border of a data bar.

◆ GetINegativeBarFormat()

virtual intrusive_ptr<Aspose::Cells::INegativeBarFormat> Aspose::Cells::IDataBar::GetINegativeBarFormat ( )
pure virtual

Gets the NegativeBarFormat object associated with a data bar conditional formatting rule.

◆ GetMaxICfvo()

virtual intrusive_ptr<Aspose::Cells::IConditionalFormattingValue> Aspose::Cells::IDataBar::GetMaxICfvo ( )
pure virtual

Gets this DataBar's max value object. Cannot set null or CFValueObject with type FormatConditionValueType.Min to it.

◆ GetMaxLength()

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::IDataBar::GetMaxLength ( )
pure virtual

Represents the max length of data bar .

◆ GetMinICfvo()

virtual intrusive_ptr<Aspose::Cells::IConditionalFormattingValue> Aspose::Cells::IDataBar::GetMinICfvo ( )
pure virtual

Gets this DataBar's min value object. Cannot set null or CFValueObject with type FormatConditionValueType.Max to it.

◆ GetMinLength()

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::IDataBar::GetMinLength ( )
pure virtual

Represents the min length of data bar .

◆ GetShowValue()

virtual bool Aspose::Cells::IDataBar::GetShowValue ( )
pure virtual

Get the flag indicating whether to show the values of the cells on which this data bar is applied. Default value is true.

◆ SetAxisColor()

virtual void Aspose::Cells::IDataBar::SetAxisColor ( intrusive_ptr< Aspose::Cells::Systems::Drawing::Color >  value)
pure virtual

Sets the color of the axis for cells with conditional formatting as data bars.

◆ SetAxisPosition()

virtual void Aspose::Cells::IDataBar::SetAxisPosition ( Aspose::Cells::DataBarAxisPosition  value)
pure virtual

Sets the position of the axis of the data bars specified by a conditional formatting rule.

◆ SetBarFillType()

virtual void Aspose::Cells::IDataBar::SetBarFillType ( Aspose::Cells::DataBarFillType  value)
pure virtual

Sets how a data bar is filled with color.

◆ SetColor()

virtual void Aspose::Cells::IDataBar::SetColor ( intrusive_ptr< Aspose::Cells::Systems::Drawing::Color >  value)
pure virtual

Sets this DataBar's Color.

◆ SetDirection()

virtual void Aspose::Cells::IDataBar::SetDirection ( Aspose::Cells::TextDirectionType  value)
pure virtual

Sets the direction the databar is displayed.

◆ SetMaxLength()

virtual void Aspose::Cells::IDataBar::SetMaxLength ( Aspose::Cells::Systems::Int32  value)
pure virtual

Represents the max length of data bar .

◆ SetMinLength()

virtual void Aspose::Cells::IDataBar::SetMinLength ( Aspose::Cells::Systems::Int32  value)
pure virtual

Represents the min length of data bar .

◆ SetShowValue()

virtual void Aspose::Cells::IDataBar::SetShowValue ( bool  value)
pure virtual

Set the flag indicating whether to show the values of the cells on which this data bar is applied. Default value is true.

◆ ToImage()

virtual intrusive_ptr<Aspose::Cells::Systems::Array1D<Aspose::Cells::Systems::Byte> > Aspose::Cells::IDataBar::ToImage ( intrusive_ptr< Aspose::Cells::ICell cell,
intrusive_ptr< Aspose::Cells::Rendering::IImageOrPrintOptions imgOpts 
)
pure virtual

Render data bar in cell to image byte array.

Parameters
cellIndicate the data bar in which cell to be rendered
imgOptsImageOrPrintOptions contains some property of output image
Returns