private void updateChartData() {

        //
        // Get the asset allocations
        //
        int[] types = SecurityRecord.getTypes();
        double[] amounts = new double[types.length];
        int rows = positionModel.getRowCount();
        for (int row=0; row<rows; row++) {
            SecurityRecord s = positionModel.getSecurityAt(row);
            int type = s.getType();
            for (int i=0; i<types.length; i++) {
                if (type == types[i]) {
                    amounts[i] += s.getPrice()*positionModel.getSharesAt(row);
                    break;
                }
            }
        }

        //
        // Fill in the chart data
        //
        if (chartData == null)
            chartData = new ArrayList<PieChartElement>(types.length);
        else
            chartData.clear();

        int colorIndex = 0;
        for (int i=0; i<types.length; i++) {
            if (amounts[i] != 0.0) {
                chartData.add(new PieChartElement(colors[colorIndex++],
                                                  SecurityRecord.getTypeString(types[i]),
                                                  amounts[i]));
                if (colorIndex == colors.length)
                    colorIndex = 0;
            }
        }

        //
        // Update the plot with the new data
        //
        if (chart != null)
            chart.chartModified();
    }