Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support DataBar of conditional formatting rule
Implemented the databar of Conditional Type. - DataBar can be read, written, and added for basic use. - Supports reading, writing and adding using "extLst". About "extLst" - https://docs.microsoft.com/en-us/openspecs/office_standards/ms-xlsx/07d607af-5618-4ca2-b683-6a78dc0d9627 The following setting items on the Excel setting screen can be read, written, and added. - (minimum, maximum)type: Automatic, LowestValue, Number, Percent, Formula, Percentile - Direction: context, leftToRight, rightToLeft (show data bar only) - Fills Solid, Gradient - FillColor: PositiveValues, NegativeValues - Borders: Solid, None - BorderColor: PositiveValues, NegativeValues - Axis position: Automatic, Midpoint, None - Axis color
- Loading branch information
Showing
12 changed files
with
1,294 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBar.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<?php | ||
|
||
namespace PhpOffice\PhpSpreadsheet\Style\ConditionalFormatting; | ||
|
||
use PhpOffice\PhpSpreadsheet\Style\Color; | ||
|
||
class ConditionalDataBar | ||
{ | ||
/** <dataBar> attribute */ | ||
/** @var boolean|null */ | ||
private $showValue; | ||
|
||
/** <dataBar> children */ | ||
/** @var ConditionalFormatValueObject */ | ||
private $minimumConditionalFormatValueObject; | ||
/** @var ConditionalFormatValueObject */ | ||
private $maximumConditionalFormatValueObject; | ||
|
||
/** @var string */ | ||
private $color; | ||
|
||
/** <extLst> */ | ||
/** @var ConditionalFormattingRuleExtension */ | ||
private $conditionalFormattingRuleExt; | ||
|
||
/** | ||
* @return boolean|null | ||
*/ | ||
public function getShowValue() | ||
{ | ||
return $this->showValue; | ||
} | ||
|
||
/** | ||
* @param boolean $showValue | ||
*/ | ||
public function setShowValue($showValue) | ||
{ | ||
$this->showValue = $showValue; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return ConditionalFormatValueObject | ||
*/ | ||
public function getMinimumConditionalFormatValueObject() | ||
{ | ||
return $this->minimumConditionalFormatValueObject; | ||
} | ||
|
||
/** | ||
* @param ConditionalFormatValueObject $minimumConditionalFormatValueObject | ||
*/ | ||
public function setMinimumConditionalFormatValueObject(ConditionalFormatValueObject $minimumConditionalFormatValueObject) | ||
{ | ||
$this->minimumConditionalFormatValueObject = $minimumConditionalFormatValueObject; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return ConditionalFormatValueObject | ||
*/ | ||
public function getMaximumConditionalFormatValueObject() | ||
{ | ||
return $this->maximumConditionalFormatValueObject; | ||
} | ||
|
||
/** | ||
* @param ConditionalFormatValueObject $maximumConditionalFormatValueObject | ||
*/ | ||
public function setMaximumConditionalFormatValueObject(ConditionalFormatValueObject $maximumConditionalFormatValueObject) | ||
{ | ||
$this->maximumConditionalFormatValueObject = $maximumConditionalFormatValueObject; | ||
return $this; | ||
} | ||
|
||
|
||
public function getColor(): string | ||
{ | ||
return $this->color; | ||
} | ||
|
||
public function setColor(string $color): self | ||
{ | ||
$this->color = $color; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return ConditionalFormattingRuleExtension | ||
*/ | ||
public function getConditionalFormattingRuleExt() | ||
{ | ||
return $this->conditionalFormattingRuleExt; | ||
} | ||
|
||
/** | ||
* @param ConditionalFormattingRuleExtension $conditionalFormattingRuleExt | ||
*/ | ||
public function setConditionalFormattingRuleExt(ConditionalFormattingRuleExtension $conditionalFormattingRuleExt) | ||
{ | ||
$this->conditionalFormattingRuleExt = $conditionalFormattingRuleExt; | ||
return $this; | ||
} | ||
} |
Oops, something went wrong.