SpreadJS Documentation
GC.Spread.Sheets Namespace / ConditionalFormatting type / DataBarRule Method
The minimum scale type.
The minimum scale value.
The maximum scale type.
The maximum scale value.
The fill color of the data bar.
The data bar rule effected range.
In This Topic
    DataBarRule Method
    In This Topic
    Represents a data bar conditional rule with the specified parameters.
    Syntax
    var value; // Type: any
    value = GC.Spread.Sheets.ConditionalFormatting.DataBarRule(minType, minValue, maxType, maxValue, color, ranges);
    function DataBarRule( 
       minType : ScaleValueType,
       minValue : object,
       maxType : ScaleValueType,
       maxValue : object,
       color : string,
       ranges : undefined
    ) : any;

    Parameters

    minType
    The minimum scale type.
    minValue
    The minimum scale value.
    maxType
    The maximum scale type.
    maxValue
    The maximum scale value.
    color
    The fill color of the data bar.
    ranges
    The data bar rule effected range.
    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 dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number, -1, GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number, 40, "green", [new GC.Spread.Sheets.Range(0,0,4,1)]);
    dataBarRule.color("green");
    dataBarRule.showBorder(true);
    dataBarRule.borderColor("orange");
    dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight);
    dataBarRule.negativeFillColor("yellow");
    dataBarRule.useNegativeFillColor(true);
    dataBarRule.negativeBorderColor("red");
    dataBarRule.useNegativeBorderColor(true);
    dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic);
    dataBarRule.axisColor("blue");
    dataBarRule.showBarOnly(false);
    activeSheet.conditionalFormats.addRule(dataBarRule);
    See Also