Convert a balance data structure into RingChartItem objects.

def balance_to_ringchart_items(balance, account='', show=SHOW_CREDIT):
    """Convert a balance data structure into RingChartItem objects."""
    show = show if show else SHOW_CREDIT  # cannot show all in ring chart
    rcis = []
    for item in balance:
        subaccount = item['account_fragment'] if not account \
            else ':'.join((account, item['account_fragment']))
        ch = balance_to_ringchart_items(item['children'], subaccount, show)
        amount = item['balance'] if show == SHOW_CREDIT else -item['balance']
        if amount < 0:
            continue  # omit negative amounts
        wedge_amount = max(amount, sum(map(float, ch)))
        rci = gtkchartlib.ringchart.RingChartItem(
            wedge_amount,
            tooltip='{}\n{}'.format(subaccount, wedge_amount),
            items=ch
        )
        rcis.append(rci)
    return rcis