How to add color scales to ODF?
Eike Rathke
erack at redhat.com
Fri May 11 04:21:49 PDT 2012
Hi Markus,
On Friday, 2012-05-11 03:20:37 +0200, Markus Mohrhard wrote:
> A possible way a color scale entry would look like is:
>
> <colorScale range="$A$4:$D$10">
> <entry type="value" val="10" col="ff11ff">
> <entry type="max" col="ffffff">
> </colorScale>
> <colorScale range="$H3:$I$20">
> <entry type="min" col="ff11ff">
> <entry type="percent" val="30" col="aaaaaa">
> <entry type="percent" val="70" col="bbbbbb">
> <entry type="max" col="ffffff">
> </colorScale>
Taking Michael's suggestion
<style:style style:name="ce1" style:family="table-cell">
<style:color-scale style:color-scale-minimum="CCCCCC"
style:color-scale-minimum-value="3" style:color-scale-maximum="444444"
style:color-scale-maximum-value="42"/>
</style:style>
and applying your example this could be something like
<style:style style:name="ce1" style:family="table-cell">
<style:color-scale>
<style:color-scale-entry fo:background-color="#ff11ff" office:value="10"/>
<style:color-scale-entry style:color-scale-maximum="#ffffff"/>
</style:color-scale>
</style:style>
<style:style style:name="ce2" style:family="table-cell">
<style:color-scale>
<style:color-scale-entry style:color-scale-minimum="#ff11ff"/>
<style:color-scale-entry style:color-scale-percent="30" fo:background-color="#aaaaaa"/>
<style:color-scale-entry style:color-scale-percent="70" fo:background-color="#bbbbbb"/>
<style:color-scale-entry style:color-scale-maximum="#ffffff"/>
</style:color-scale>
</style:style>
For type="value" above, can also strings be colored differently? Then
we'd need to use office:value-type as well.
> For color scales and data bars( that are more or less just another way
> to represent the same information ) there are quite some differences
> to normal conditional formatting. One important difference is that the
> range the color scale is applied to is really important (min, max,
> percent, percentile) don't make sense without a range.
I think that can be expressed in the specification saying that a style
containing <style:color-scale> needs to be applied on a contiguous
range. Not sure though. If not, then things get complicated.
Eike
--
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GnuPG key 0x293C05FD : 997A 4C60 CE41 0149 0DB3 9E96 2F1A D073 293C 05FD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120511/5319afd6/attachment-0001.pgp>
More information about the LibreOffice
mailing list