value property

String value
getter/setter pair

Gets or sets the shortest bar or longest bar threshold value for a data

IconSets use IconSet.iconCriteria list property to set icons, So each ConditionValue object has individual ConditionValue.value property. By default the IconSet.iconCriteria list property holds three objects and those object's ConditionValue.value property set "0", "33" and "67" respectively. In our example, we set "20" and "70" to ConditionValue.value property of second and third objects in iconSet.iconCriteria list property.

// Create a new Excel Document.
final Workbook workbook = Workbook();
// Accessing sheet via index.
final Worksheet sheet = workbook.worksheets[0];

sheet.getRangeByName('A1').number = 125;
sheet.getRangeByName('A2').number = 279;
sheet.getRangeByName('A3').number = 42;
sheet.getRangeByName('A4').number = 384;
sheet.getRangeByName('A5').number = 129;
sheet.getRangeByName('A6').number = 212;
sheet.getRangeByName('A7').number = 131;
sheet.getRangeByName('A8').number = 230;

//Create iconset for the data in specified range.
final ConditionalFormats conditionalFormats =
    sheet.getRangeByName('A1:A8').conditionalFormats;
final ConditionalFormat conditionalFormat =
    conditionalFormats.addCondition();

//Set FormatType as IconSet.
conditionalFormat.formatType = ExcelCFType.iconSet;
final IconSet iconSet = conditionalFormat.iconSet;

//Set conditions for IconCriteria.
//Set icon set.
iconSet.iconSet = ExcelIconSetType.threeSymbols;
// Set Type and Value.
iconSet.iconCriteria[1].type = ConditionValueType.percentile;
iconSet.iconCriteria[1].value = "20";
// set operators
iconSet.iconCriteria[1].operator = ConditionalFormatOperator.greaterThan;
iconSet.iconCriteria[2].type = ConditionValueType.percentile;
iconSet.iconCriteria[2].value = "70";
// set operators
iconSet.iconCriteria[2].operator = ConditionalFormatOperator.greaterThan;

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

For DataBars the default value of ConditionValue.value property is set to "0". This property is can be changed by getting DataBar.minPoint or DataBar.maxPoint properties. These two properties define the shortest and longest bars of DataBar. For example, we have set the ConditionValue.value of DataBar.minPoint to "30".

// Create a new Excel Document.
final Workbook workbook = Workbook();
// Accessing sheet via index.
final Worksheet sheet = workbook.worksheets[0];

sheet.getRangeByName('A1').number = 125;
sheet.getRangeByName('A2').number = 279;
sheet.getRangeByName('A3').number = 42;
sheet.getRangeByName('A4').number = 384;
sheet.getRangeByName('A5').number = 129;
sheet.getRangeByName('A6').number = 212;
sheet.getRangeByName('A7').number = 131;
sheet.getRangeByName('A8').number = 230;

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

//Set conditions.
conditionalFormat.formatType = ExcelCFType.dataBar;
final DataBar dataBar = conditionalFormat.dataBar;

//Set the type and value.
dataBar.minPoint.type = ConditionValueType.percent;
dataBar.minPoint.value ='30';

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

//Hide the data bar values
dataBar.showValue = false;

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

To set the value for ColorScale refer ColorConditionValue.value property.

Implementation

late String value;