Hey, I just reached a state where I can think about adding support for color scales into ODF. Normally this would not be such a big deal but for color scales we face several problems. Color scales are a form of conditional formatting but our current conditional formatting system is based on styles where color scales ( and data bars ) don't fit in. The problem is now that conditional formatting is part of the styles in ODF and applied to a cell through a style. I have the same problem internally but there I was able to circumvent that problem till now by implementing a own set of data structures for color scales. The current structure of a conditional format in ods looks like: <style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default"> <style:map style:condition="cell-content()=1" style:apply-style-name="Untitled1" style:base-cell-address="Sheet1.D5"/> <style:map style:condition="cell-content()<0" style:apply-style-name="Untitled2" style:base-cell-address="Sheet1.D5"/> <style:map style:condition="cell-content-is-between(2,3)" style:apply-style-name="Untitled3" style:base-cell-address="Sheet1.D5"/> </style:style> Now we have color scales which are no longer bound to styles because they calculate the correct formatting information based on the value of the cell. I would not want to add them to the existing style based system because they don't fit into there. We will need to add different conditions for them and different ways to represent them. In OOXML normal conditional formats are represented in the [sheetx].xml file and refer to formatting changes in the styles section. Color scales however are represented in the same structure but contain all their information as sub elements. The structure of the attached test file is: <conditionalFormatting sqref="C2:D5"> <cfRule type="colorScale" priority="1"> <colorScale> <cfvo type="num" val="0"/> <cfvo type="num" val="10"/> <color rgb="FF63BE7B"/> <color rgb="FFFFEF9C"/> </colorScale> </cfRule> </conditionalFormatting> I'm open for suggestions how I can add this sanely to ods. I would like to support as much from MSO 2010's color scale feature as possible but have no idea yet what I can achieve in the remaining 4 weeks. Regards, Markus Attached is my test document ( the only document that I support right now ) and a screenshot showing how it is rendered right now. I know that it is not rendered correctly right now.
Attachment:
SimpleColorScale.xlsx
Description: MS-Excel 2007 spreadsheet
Attachment:
color_scales.png
Description: PNG image