SpreadJS Documentation
DataBarRule class
Represents a data bar conditional rule with the specified parameters.
Syntax
var instance = new GcSpread.Sheets.DataBarRule(minType, minValue, maxType, maxValue, color);
function DataBarRule;
Example
This example creates a data bar rule.
activeSheet.setValue(0,0,1,3);
activeSheet.setValue(1,0,15,3);
activeSheet.setValue(2,0,25,3);
activeSheet.setValue(3,0,-1,3);
var cfs = activeSheet.getConditionalFormats();
var dataBarRule = new GcSpread.Sheets.DataBarRule();
dataBarRule.ranges=[new GcSpread.Sheets.Range(0,0,4,1)];
dataBarRule.minimumType(GcSpread.Sheets.ScaleValueType.Number);
dataBarRule.minimumValue(-1);
dataBarRule.maximumType(GcSpread.Sheets.ScaleValueType.Number);
dataBarRule.maximumValue(40);
dataBarRule.color("green");
dataBarRule.showBorder(true);
dataBarRule.borderColor("orange");
dataBarRule.dataBarDirection(GcSpread.Sheets.BarDirection.LeftToRight);
dataBarRule.negativeFillColor("yellow");
dataBarRule.useNegativeFillColor(true);
dataBarRule.negativeBorderColor("red");
dataBarRule.useNegativeBorderColor(true);
dataBarRule.axisPosition(GcSpread.Sheets.DataBarAxisPosition.Automatic);
dataBarRule.axisColor("blue");
dataBarRule.showBarOnly(false);
cfs.addRule(dataBarRule);
Inheritance Hierarchy

Object
   GcSpread.Sheets.ScaleRule
      GcSpread.Sheets.DataBarRule

Constructors
 NameDescription
public ConstructorDataBarRule ConstructorRepresents a data bar conditional rule with the specified parameters.  
Top
Fields
 NameDescription
public Fieldranges (Inherited from GcSpread.Sheets.ConditionRuleBase)
public Fieldstyle (Inherited from GcSpread.Sheets.ConditionRuleBase)
Top
Methods
 NameDescription
public MethodaxisColorGets or sets the axis color of the data bar.  
public MethodaxisPositionGets or sets the axis position of the data bar.  
public MethodborderColorGets or sets the color of the border.  
public MethodcolorGets or sets the postive fill color of the data bar.  
public Methodcontains (Inherited from GcSpread.Sheets.ConditionRuleBase)
public MethoddataBarDirectionGets or sets the data bar direction.  
public MethodevaluateReturns the specified value of the rule if the cell meets the condition.  
public MethodgetExpected (Inherited from GcSpread.Sheets.ConditionRuleBase)
public MethodgradientGets or sets a value that indicates whether the data bar is a gradient.  
public Methodintersects (Inherited from GcSpread.Sheets.ConditionRuleBase)
public MethodmaximumTypeGets or sets the maximum scale type.  
public MethodmaximumValueGets or sets the maximum scale value.  
public MethodminimumTypeGets or sets the minimum scale type.  
public MethodminimumValueGets or sets the minimum scale value.  
public MethodnegativeBorderColorGets or sets the color of the negative border.  
public MethodnegativeFillColorGets or sets the color of the negative fill.  
public Methodpriority (Inherited from GcSpread.Sheets.ConditionRuleBase)
public Methodreset (Inherited from GcSpread.Sheets.ConditionRuleBase)
public MethodshowBarOnlyGets or sets whether to display the data bar without text.  
public MethodshowBorderGets or sets a value that indicates whether to paint the border.  
public MethodstopIfTrue (Inherited from GcSpread.Sheets.ScaleRule)
public MethoduseNegativeBorderColorGets or sets a value that indicates whether the negative border color is used to paint the border for the negative value.  
public MethoduseNegativeFillColorGets or sets a value that indicates whether the negative fill color is used to paint the negative value.  
Top
See Also

Reference

GcSpread.Sheets Namespace
Using the Data Bar Rule

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.