Range rule
Methods
conditionalFormatRange(string $rangeA1, \Vtiful\Kernel\ConditionalFormat $cf): selfstring $rangeA1
\Vtiful\Kernel\ConditionalFormat $cf
Greater-than across a range
$config = ['path' => './tests'];
$excel = new \Vtiful\Kernel\Excel($config);
$fileObject = $excel->fileName('tutorial.xlsx');
$fileHandle = $fileObject->getHandle();
$highlight = (new \Vtiful\Kernel\Format($fileHandle))
->background(\Vtiful\Kernel\Format::COLOR_RED)
->fontColor(\Vtiful\Kernel\Format::COLOR_WHITE)
->toResource();
$cf = new \Vtiful\Kernel\ConditionalFormat();
$cf->type(\Vtiful\Kernel\ConditionalFormat::TYPE_CELL)
->criteria(\Vtiful\Kernel\ConditionalFormat::CRITERIA_GREATER_THAN)
->value(50)
->format($highlight);
$fileObject->header(['score'])
->data([[10], [40], [55], [60], [70], [80], [90], [100], [120]])
->conditionalFormatRange('A2:A10', $cf)
->output();Two-colour scale
Three-colour scale
Formula rule
Last updated