afreechart/src/main/java/org/afree/chart/renderer/xy/GradientXYBarPainter.java
/**
     * Splits a bar into subregions (elsewhere, these subregions will have
     * different gradients applied to them).
     *
     * @param bar  the bar shape.
     * @param a  the first division.
     * @param b  the second division.
     * @param c  the third division.
     *
     * @return An array containing four subregions.
     */
Splits a bar into subregions (elsewhere, these subregions will have
different gradients applied to them).

@param bar  the bar shape.
@param a  the first division.
@param b  the second division.
@param c  the third division.

@return An array containing four subregions.
Splits a bar into subregions ( elsewhere these subregions will have different gradients applied to them ) . @param bar the bar shape . @param a the first division . @param b the second division . @param c the third division . @return An array containing four subregions .
protected RectShape[] splitVerticalBar(RectShape bar, double a,
            double b, double c) {
        RectShape[] result = new RectShape[4];
        double x0 = bar.getMinX();
        double x1 = Math.rint(x0 + (bar.getWidth() * a));
        double x2 = Math.rint(x0 + (bar.getWidth() * b));
        double x3 = Math.rint(x0 + (bar.getWidth() * c));
        result[0] = new RectShape(bar.getMinX(), bar.getMinY(),
                x1 - x0, bar.getHeight());
        result[1] = new RectShape(x1, bar.getMinY(), x2 - x1,
                bar.getHeight());
        result[2] = new RectShape(x2, bar.getMinY(), x3 - x2,
                bar.getHeight());
        result[3] = new RectShape(x3, bar.getMinY(),
                bar.getMaxX() - x3, bar.getHeight());
        return result;
    }
protected RectShape [ ] splitVerticalBar ( RectShape bar , double a , double b , double c ) { RectShape [ ] result = new RectShape [ 4 ] ; double x0 = bar . getMinX ( ) ; double x1 = Math . rint ( x0 + ( bar . getWidth ( ) * a ) ) ; double x2 = Math . rint ( x0 + ( bar . getWidth ( ) * b ) ) ; double x3 = Math . rint ( x0 + ( bar . getWidth ( ) * c ) ) ; result [ 0 ] = new RectShape ( bar . getMinX ( ) , bar . getMinY ( ) , x1 - x0 , bar . getHeight ( ) ) ; result [ 1 ] = new RectShape ( x1 , bar . getMinY ( ) , x2 - x1 , bar . getHeight ( ) ) ; result [ 2 ] = new RectShape ( x2 , bar . getMinY ( ) , x3 - x2 , bar . getHeight ( ) ) ; result [ 3 ] = new RectShape ( x3 , bar . getMinY ( ) , bar . getMaxX ( ) - x3 , bar . getHeight ( ) ) ; return result ; }
Splits a bar into subregions (elsewhere, these subregions will have
 different gradients applied to them).
Splits a bar into subregions ( elsewhere these subregions will have different gradients applied to them ) .