RealGrid2 API
Interface
BarCellRenderer

BarCellRenderer

A renderer that displays the value of a numeric column cell as a bar.

Signature:

export interface BarCellRenderer extends CellRenderer

Extends: CellRenderer

Remarks

[Superclass]

CellRenderer

Example

//string type
column.renderer = 'bar';
 
//object type
column.renderer = {
      "type": "bar",
      "minimum": 0;
      "maximum": 100;
      "minWidth": 150;
      "showLabel": true,
      "origin": "left"
}

Properties

PropertyTypeDescription
absoluteValuebooleanWhether to render based on absolute value
barStylestringStyle name for the bar starting from the left
barWidthnumber | stringWidth of bar
baseValuenumberIf the value is specified, values larger than middleValue are displayed on the right and values smaller than middleValue are displayed on the left.
bottomBarStylestringStyle name for the bar starting at the bottom
maximumnumbermaximum value
minimumnumberMinimum value
negativeStylestringStyle name applied when the value is smaller than baseValue
originBarOriginStarting position of the bar
rightBarStylestringStyle name for the bar starting from the right
showLabelbooleanWhether to display Label
textOffsetnumberSpacing between bar and text when baseValue is specified
topBarStylestringStyle name for the bar starting at the top
type"bar"Type: Bar

Properties Desc

absoluteValue

Whether to render based on absolute value

Type - boolean


barStyle

Style name for the bar starting from the left

Type - string


barWidth

width of the bar

Type - number | string


baseValue

When a value is specified, values greater than middleValue are displayed on the right, and values smaller than middleValue are displayed on the left.

Type - number

Remarks:

Applies only when origin is BarOrigin.LEFT or BarOrigin.BOTTOM.


bottomBarStyle

Style name for the bar starting at the bottom

Type - string


maximum

maximum value

Type - number


minimum

minimum value

Type - number


negativeStyle

Style name applied when the value is less than baseValue

Type - string


origin

starting position of the bar

Type - BarOrigin


rightBarStyle

Style name for the bar starting on the right

Type - string


showLabel

Whether to display the label

Type - boolean


textOffset

Spacing between bar and text when baseValue is specified

Type - number

Remarks:

If the value is 0, it is output in the middle of the cell.


topBarStyle

Style name for the bar starting at the top

Type - string


type

Type: Bar

Type - "bar"