[]
Use this interface to configure how negative values are displayed in a data bar rule, including whether their fill and border use dedicated colors or the same colors as positive data bars.
worksheet.getRange("A1:A4").setValue(new Object[][] {{-10}, {-5}, {0}, {20}});
IDataBar dataBar = worksheet.getRange("A1:A4").getFormatConditions().addDatabar();
INegativeBarFormat negativeBarFormat = dataBar.getNegativeBarFormat();
negativeBarFormat.setColorType(DataBarNegativeColorType.Color);
negativeBarFormat.setBorderColorType(DataBarNegativeColorType.SameAsPositive);
getColor()voidvoidUse the returned IFormatColor object to customize the dedicated border color when setBorderColorType(DataBarNegativeColorType) is set to DataBarNegativeColorType.Color.
worksheet.getRange("A1:A4").setValue(new Object[][] {{-10}, {-5}, {0}, {20}});
IDataBar dataBar = worksheet.getRange("A1:A4").getFormatConditions().addDatabar();
INegativeBarFormat negativeBarFormat = dataBar.getNegativeBarFormat();
negativeBarFormat.setBorderColorType(DataBarNegativeColorType.Color);
IFormatColor borderColor = negativeBarFormat.getBorderColor();
borderColor.setColor(Color.GetRed());
IFormatColor object that specifies the border color for negative data bars.Returns a DataBarNegativeColorType value that indicates whether negative data bars use the same border color as positive data bars or use the color specified by getBorderColor().
worksheet.getRange("A1:A4").setValue(new Object[][] {{-10}, {-5}, {0}, {20}});
IDataBar dataBar = worksheet.getRange("A1:A4").getFormatConditions().addDatabar();
dataBar.getNegativeBarFormat().setBorderColorType(DataBarNegativeColorType.SameAsPositive);
DataBarNegativeColorType borderColorType = dataBar.getNegativeBarFormat().getBorderColorType();
DataBarNegativeColorType value that specifies how the border color of negative data bars is determined.Use DataBarNegativeColorType.SameAsPositive to make negative data bars use the positive bar border color, or DataBarNegativeColorType.Color to use a dedicated border color for negative data bars.
worksheet.getRange("A1:A4").setValue(new Object[][] {{-10}, {-5}, {0}, {20}});
IDataBar dataBar = worksheet.getRange("A1:A4").getFormatConditions().addDatabar();
INegativeBarFormat negativeBarFormat = dataBar.getNegativeBarFormat();
negativeBarFormat.setBorderColorType(DataBarNegativeColorType.Color);
value - The negative data bar border color behavior.Use the returned IFormatColor object to customize the dedicated fill color when setColorType(DataBarNegativeColorType) is set to DataBarNegativeColorType.Color.
worksheet.getRange("A1:A4").setValue(new Object[][] {{-10}, {-5}, {0}, {20}});
IDataBar dataBar = worksheet.getRange("A1:A4").getFormatConditions().addDatabar();
INegativeBarFormat negativeBarFormat = dataBar.getNegativeBarFormat();
negativeBarFormat.setColorType(DataBarNegativeColorType.Color);
IFormatColor color = negativeBarFormat.getColor();
color.setColor(Color.GetRed());
IFormatColor object that specifies the fill color for negative data bars.Returns a DataBarNegativeColorType value that indicates whether negative data bars use their own fill color or reuse the positive data bar fill color.
worksheet.getRange("A1:A4").setValue(new Object[][] {{-10}, {-5}, {0}, {20}});
IDataBar dataBar = worksheet.getRange("A1:A4").getFormatConditions().addDatabar();
dataBar.getNegativeBarFormat().setColorType(DataBarNegativeColorType.SameAsPositive);
DataBarNegativeColorType colorType = dataBar.getNegativeBarFormat().getColorType();
DataBarNegativeColorType value that specifies whether negative data bars use the same fill color as positive data bars.Use DataBarNegativeColorType.SameAsPositive to make negative data bars use the positive data bar fill color, or DataBarNegativeColorType.Color to use the dedicated negative bar fill color.
worksheet.getRange("A1:A4").setValue(new Object[][] {{-10}, {-5}, {0}, {20}});
IDataBar dataBar = worksheet.getRange("A1:A4").getFormatConditions().addDatabar();
INegativeBarFormat negativeBarFormat = dataBar.getNegativeBarFormat();
negativeBarFormat.setColorType(DataBarNegativeColorType.SameAsPositive);
value - The negative data bar fill color mode. Must not be null.