Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional styling doesnt support color scale with number or percentage #4049

Closed
bokrma opened this issue May 29, 2024 · 1 comment · Fixed by #4050
Closed

Conditional styling doesnt support color scale with number or percentage #4049

bokrma opened this issue May 29, 2024 · 1 comment · Fixed by #4050

Comments

@bokrma
Copy link

bokrma commented May 29, 2024

I checked the code for getting the details of conditional styling, but seems like I cant get the color scale with number or percentage if it was inside the sheet:
Untitled_spreadsheet_7.xlsx

Screenshot 2024-05-29 at 16 10 20

is it gonna be supported?

@oleibman
Copy link
Collaborator

Thank you for the sample spreadsheet. PhpSpreadsheet is expecting the following optional xml tags:

<colorScale>
<cfvo type="min"/>
<cfvo type="percentile" val="40"/>
<cfvo type="max"/>
...
</colorScale>

Your sample has the following xml:

<colorScale>
<cfvo type="formula" val="25"/>
<cfvo type="max"/>
...
</colorScale>

The formula tag is obviously taking the place of min here. I imagine it might take the place of either of the other two as well. I need to figure out how it works, especially since, as we see in your sample, at least one of the tags can be omitted.

oleibman added a commit to oleibman/PhpSpreadsheet that referenced this issue May 30, 2024
Fix PHPOffice#4049. Some possible options were not included for read or write. In addition, although it isn't well documented, it appears that 2-color scale always has 2 cvfo entries in Xml in order minimum/maximum, and 3-color scale always has 3 entries in order minimum/midpoint/maximum.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants