boPlotBackground.setHeight(daY[0] - daY[1] + insCA.getTop() + insCA.getBottom());
boPlotBackground.setHeight(daY[0] - daY[1] + insCA.getTop() + insCA.getBottom() + 1);
    public final void compute(Bounds bo) throws PluginException, DataFormatException, DataSetException,        GenerationException, NullValueException, UnexpectedInputException    {        bo = bo.scaledInstance(dPointToPixel); // CONVERSION        dSeriesThickness = (ids.getDpiResolution()/72d) * cwa.getSeriesThickness();        // MAINTAIN IN LOCAL VARIABLES FOR PERFORMANCE/CONVENIENCE        double dX = bo.getLeft() + insCA.getLeft();        double dY = bo.getTop() + insCA.getTop();        double dW = bo.getWidth() - insCA.getLeft() - insCA.getRight();        double dH = bo.getHeight() - insCA.getTop() - insCA.getBottom();        iDimension = getDimension(cwa.getDimension());        dXAxisPlotSpacing = cwa.getPlot().getHorizontalSpacing() * dPointToPixel; // CONVERSION        dYAxisPlotSpacing = cwa.getPlot().getVerticalSpacing() * dPointToPixel; // CONVERSION        if (iDimension == TWO_5_D)        {            dY += dSeriesThickness;            dH -= dSeriesThickness;            dW -= dSeriesThickness;            bo.setHeight(dH);            bo.setTop(dY);            bo.setWidth(dW);        }        // PLACE OVERLAYS FIRST TO REDUCE VIRTUAL PLOT BOUNDS        if (aax.getOverlayCount() > 0)        {            if (aax.areAxesSwapped()) // ORTHOGONAL OVERLAYS = HORIZONTAL            {                updateOverlayScales(aax, dX, dX + dW, dY, dH);                dY = aax.getStart();                dH = aax.getLength();            }            else            // ORTHOGONAL OVERLAYS = VERTICAL            {                updateOverlayScales(aax, dY - dH, dY, dX, dW);                dX = aax.getStart();                dW = aax.getLength();            }        }        double dStart, dEnd;        final Axis[] axa = cwa.getPrimaryBaseAxes();        final Axis axPrimaryBase = axa[0];        final Axis axPrimaryOrthogonal = cwa.getPrimaryOrthogonalAxis(axPrimaryBase);        Scale sc = axPrimaryBase.getScale();        // COMPUTE PRIMARY-BASE-AXIS PROPERTIES AND ITS SCALE        AutoScale scPrimaryBase = null;        OneAxis oaxPrimaryBase = aax.getPrimaryBase();        int iAxisType = getAxisType(axPrimaryBase);        Object oaData = null;        if (iAxisType == TEXT || oaxPrimaryBase.isCategoryScale())        {            oaData = getTypedDataSet(axPrimaryBase, iAxisType, 0);        }        else if ((iAxisType & NUMERICAL) == NUMERICAL)        {            oaData = getMinMax(axPrimaryBase, iAxisType);        }        else if ((iAxisType & DATE_TIME) == DATE_TIME)        {            oaData = getMinMax(axPrimaryBase, iAxisType);        }        DataSetIterator dsi = (oaData instanceof DataSetIterator) ? (DataSetIterator) oaData : new DataSetIterator(            oaData, iAxisType);        oaData = null;        dStart = (aax.areAxesSwapped()) ? dY + dH : dX;        dEnd = (aax.areAxesSwapped()) ? dY : dStart + dW;        scPrimaryBase = AutoScale.computeScale(ids, oaxPrimaryBase, dsi, iAxisType, dStart, dEnd, sc.getMin(), sc            .getMax(), sc.isSetStep() ? new Double(sc.getStep()) : null, axPrimaryBase.getFormatSpecifier(), lcl);        oaxPrimaryBase.set(scPrimaryBase); // UPDATE SCALE ON PRIMARY-BASE        // AXIS        // COMPUTE PRIMARY-ORTHOGONAL-AXIS PROPERTIES AND ITS SCALE        AutoScale scPrimaryOrthogonal = null;        OneAxis oaxPrimaryOrthogonal = aax.getPrimaryOrthogonal();        iAxisType = getAxisType(axPrimaryOrthogonal);        oaData = null;        if ((iAxisType & NUMERICAL) == NUMERICAL || (iAxisType & DATE_TIME) == DATE_TIME)        {            dsi = new DataSetIterator(getMinMax(axPrimaryOrthogonal, iAxisType), iAxisType);        }        else        {            throw new DataFormatException("The orthogonal axis may only have a numerical or datetime format");        }        dStart = (aax.areAxesSwapped()) ? dX : dY + dH;        dEnd = (aax.areAxesSwapped()) ? dX + dW : dY;        sc = axPrimaryOrthogonal.getScale();        scPrimaryOrthogonal = AutoScale.computeScale(ids, oaxPrimaryOrthogonal, dsi, iAxisType, dStart, dEnd, sc            .getMin(), sc.getMax(), sc.isSetStep() ? new Double(sc.getStep()) : null, axPrimaryOrthogonal            .getFormatSpecifier(), lcl);        oaxPrimaryOrthogonal.set(scPrimaryOrthogonal); // UPDATE SCALE ON        // PRIMARY-ORTHOGONAL        // AXIS        // ITERATIVELY ADJUST THE PRIMARY ORTHOGONAL AXIS POSITION DUE TO THE        // SCALE, START/END LABELS        double dYAxisLocation = adjustHorizontal(dX, dW, aax);        // ITERATIVELY ADJUST THE PRIMARY BASE AXIS POSITION DUE TO THE SCALE,        // START/END LABELS        double dXAxisLocation = adjustVerticalDueToHorizontal(dY, dH, aax);        // SETUP THE FULL DATASET FOR THE PRIMARY ORTHOGONAL AXIS        iAxisType = getAxisType(axPrimaryOrthogonal);        oaData = getTypedDataSet(axPrimaryOrthogonal, iAxisType, 0);        scPrimaryOrthogonal.setData(dsi);        // SETUP THE FULL DATASET FOR THE PRIMARY ORTHOGONAL AXIS        iAxisType = getAxisType(axPrimaryBase);        if (iAxisType != IConstants.TEXT)        {            scPrimaryBase.setData(getTypedDataSet(axPrimaryBase, iAxisType, 0));        }        scPrimaryBase.resetShifts();        scPrimaryOrthogonal.resetShifts();        // UPDATE THE SIZES OF THE OVERLAY AXES        updateOverlayAxes(aax);        growBaseAxis(aax, bo);        //dXAxisLocation = getLocation(scY,        // oaxPrimaryOrthogonal.getIntersectionValue()); // UPDATE FOR OVERLAYS        final OneAxis axPH = aax.areAxesSwapped() ? aax.getPrimaryOrthogonal() : aax.getPrimaryBase();        final OneAxis axPV = aax.areAxesSwapped() ? aax.getPrimaryBase() : aax.getPrimaryOrthogonal();        axPH.setAxisCoordinate(dXAxisLocation);        axPV.setAxisCoordinate(dYAxisLocation);        double[] daX = axPH.getScale().getEndPoints();        double[] daY = axPV.getScale().getEndPoints();        boPlotBackground.setLeft(daX[0] - insCA.getLeft());        boPlotBackground.setWidth(daX[1] - daX[0] + insCA.getLeft() + insCA.getRight());        boPlotBackground.setTop(daY[1] - insCA.getTop());        boPlotBackground.setHeight(daY[0] - daY[1] + insCA.getTop() + insCA.getBottom());        if (iDimension == TWO_5_D)        {            boPlotBackground.delta(dSeriesThickness, -dSeriesThickness, 0, 0);        }    }