Donut chart
<widget:chart ref="selection/account">
<widget:slice-serie center="instance('colors')/pie-chart/@centerColor"
ref="instance()/data/accounts/account"
type="donut">
<widget:label value="@label" />
<widget:name value="@id"; />
<widget:value value="@initial + sum(transaction/@amount)" />
<widget:color value="instance('colors')/pie-chart/color[
count(context()/preceding-sibling::account) + 1]" />
</widget:slice-serie>
</widget:chart>
Bar/line chart
<widget:chart
ref="selection/date" scale-x-type="date">
<widget:bar-serie ... </widget:bar-serie>
<widget:bar-serie ... </widget:bar-serie>
<widget:line-serie ...</widget:line-serie>
</widget:chart>
Bar/line chart (Bar serie)
<widget:bar-serie
ref="idfunc:sort(distinct-values($accounts/account[
contains(@id, $selected-account)]/transaction[@amount > 0]/@date))">
<widget:label value="." />
<widget:name value="." />
<widget:value
value="sum($accounts/account[contains(@id, $selected-account)]/
transaction[context() = @date and @amount > 0]/@amount)" />
<widget:color value="$bar-chart-colors[1]" />
</widget:bar-serie>
Bar/line chart (Line serie)
<widget:line-serie
ref="idfunc:sort(distinct-values($accounts/account[
contains(@id, $selected-account)]/transaction/@date))">
<widget:label value="." />
<widget:name value="." />
<widget:value
value="sum($accounts/account[contains(@id, $selected-account)]/@initial)
+ sum($accounts/account[contains(@id, $selected-account)]/
transaction[ context() >= @date]/@amount)" />
<widget:color value="instance('colors')/line-chart/color" />
</widget:line-serie>
Data table
<table class="data-table">
<thead>...</thead>
<tbody>
<xf:repeat ref="$accounts/account[contains(@id, $selected-account)]/transaction[selection/date = '' or xs:date(@time-stamp) = selection/date]">
<tr>
<td><xf:output ref="my:account-to-color-url(../@id, $colors)" mediatype="image/*"/></td>
<td><xf:output ref="@time-stamp"/></td>
<td><xf:output ref="@description"/></td>
<td><xf:output ref="@amount"/></td>
</tr>
</xf:repeat>
</tbody>
</table>