use of org.apache.poi.hssf.record.cf.DataBarThreshold in project poi by apache.
the class CFRule12Record method create.
/**
* Creates a new Data Bar formatting
*
* @param sheet the sheet
* @param color the data bar color
*
* @return a new Data Bar formatting
*/
public static CFRule12Record create(HSSFSheet sheet, ExtendedColor color) {
CFRule12Record r = new CFRule12Record(CONDITION_TYPE_DATA_BAR, ComparisonOperator.NO_COMPARISON);
DataBarFormatting dbf = r.createDataBarFormatting();
dbf.setColor(color);
dbf.setPercentMin((byte) 0);
dbf.setPercentMax((byte) 100);
DataBarThreshold min = new DataBarThreshold();
min.setType(RangeType.MIN.id);
dbf.setThresholdMin(min);
DataBarThreshold max = new DataBarThreshold();
max.setType(RangeType.MAX.id);
dbf.setThresholdMax(max);
return r;
}
Aggregations