Add constant interpolation on line graph
review422001
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
* Add constant interpolation on line graph
|
||||
* Add create/delete field access
|
||||
* Add dynamic size limit on the One2Many, Many2Many and Char
|
||||
* Replace __tryton__.py by tryton.cfg
|
||||
|
||||
@@ -541,6 +541,22 @@ field
|
||||
* ``empty``: defined if the line graph must put a point for missing
|
||||
dates.
|
||||
|
||||
* ``interpolation``: defined how the line graph must interpolate points.
|
||||
The default is ``linear``.
|
||||
|
||||
* ``constant-center``: use the value of the nearest point, see
|
||||
`Nearest-neighbor interpolation`_
|
||||
|
||||
* ``constant-left``: use the value of the nearest left point.
|
||||
|
||||
* ``constant-right``: use the value of the nearest right point.
|
||||
|
||||
* ``linear``: see `linear interpolation`_
|
||||
|
||||
.. _`Nearest-neighbor interpolation`:
|
||||
http://en.wikipedia.org/wiki/Nearest-neighbor_interpolation
|
||||
.. _`linear interpolation`: http://en.wikipedia.org/wiki/Linear_interpolation
|
||||
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
@@ -25,6 +25,9 @@ attlist.field &= attribute empty { "0" | "1" }?
|
||||
attlist.field &= attribute color { text }?
|
||||
attlist.field &= attribute widget { "float_time" }?
|
||||
attlist.field &= attribute float_time { text }?
|
||||
attlist.field &=
|
||||
[ a:defaultValue = "linear" ]
|
||||
attribute interpolation { "constant-left" | "constant-right" | "constant-center" | "linear" }?
|
||||
data = element data { attlist.data, xpath+ }
|
||||
attlist.data &= empty
|
||||
xpath = element xpath { attlist.xpath,
|
||||
|
||||
@@ -125,6 +125,18 @@
|
||||
<attribute name="float_time"/>
|
||||
</optional>
|
||||
</define>
|
||||
<define name="attlist.field" combine="interleave">
|
||||
<optional>
|
||||
<attribute name="interpolation" a:defaultValue="linear">
|
||||
<choice>
|
||||
<value>constant-left</value>
|
||||
<value>constant-right</value>
|
||||
<value>constant-center</value>
|
||||
<value>linear</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
</define>
|
||||
<define name="data">
|
||||
<element name="data">
|
||||
<ref name="attlist.data"/>
|
||||
|
||||
Reference in New Issue
Block a user