borderColorRgb property

Color borderColorRgb
getter/setter pair

Gets or sets the border color of the data bar in Rgb.

// Create a new Excel Document.
final Workbook workbook = Workbook();
// Accessing sheet via index.
final Worksheet sheet = workbook.worksheets[0];
sheet.getRangeByName('A1').number = 12;
sheet.getRangeByName('A2').number = 29;
sheet.getRangeByName('A3').number = 41;
sheet.getRangeByName('A4').number = -84;
sheet.getRangeByName('A5').number = 90;
sheet.getRangeByName('A6').number = 112;
sheet.getRangeByName('A7').number = 131;
sheet.getRangeByName('A8').number = 20;

//Create data bars for the data in specified range.
final ConditionalFormats conditionalFormats =
    sheet.getRangeByName('A1:A8').conditionalFormats;
final ConditionalFormat conditionalFormat = conditionalFormats.addCondition();
conditionalFormat.formatType = ExcelCFType.dataBar;
final DataBar dataBar = conditionalFormat.dataBar!;

//Set type and value.
dataBar.minPoint.type = ConditionValueType.percent;
dataBar.minPoint.value = '20';
dataBar.maxPoint.type = ConditionValueType.percent;
dataBar.maxPoint.value = '90';

//Set color for DataBar
dataBar.barColor = '#FF7C80';

//Set Border color for DataBar
dataBar.borderColorRgb = Color.fromARGB(245, 245, 44, 13);

final List<int> bytes = workbook.saveAsStream();
File('DataBar.xlsx').writeAsBytes(bytes);
workbook.dispose();

Implementation

late Color borderColorRgb;