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[] splitHorizontalBar(RectShape bar, double a,
            double b, double c) {
        RectShape[] result = new RectShape[4];
        double y0 = bar.getMinY();
        double y1 = Math.rint(y0 + (bar.getHeight() * a));
        double y2 = Math.rint(y0 + (bar.getHeight() * b));
        double y3 = Math.rint(y0 + (bar.getHeight() * c));
        result[0] = new RectShape(bar.getMinX(), bar.getMinY(),
                bar.getWidth(), y1 - y0);
        result[1] = new RectShape(bar.getMinX(), y1, bar.getWidth(),
                y2 - y1);
        result[2] = new RectShape(bar.getMinX(), y2, bar.getWidth(),
                y3 - y2);
        result[3] = new RectShape(bar.getMinX(), y3, bar.getWidth(),
                bar.getMaxY() - y3);
        return result;
    }
protected RectShape [ ] splitHorizontalBar ( RectShape bar , double a , double b , double c ) { RectShape [ ] result = new RectShape [ 4 ] ; double y0 = bar . getMinY ( ) ; double y1 = Math . rint ( y0 + ( bar . getHeight ( ) * a ) ) ; double y2 = Math . rint ( y0 + ( bar . getHeight ( ) * b ) ) ; double y3 = Math . rint ( y0 + ( bar . getHeight ( ) * c ) ) ; result [ 0 ] = new RectShape ( bar . getMinX ( ) , bar . getMinY ( ) , bar . getWidth ( ) , y1 - y0 ) ; result [ 1 ] = new RectShape ( bar . getMinX ( ) , y1 , bar . getWidth ( ) , y2 - y1 ) ; result [ 2 ] = new RectShape ( bar . getMinX ( ) , y2 , bar . getWidth ( ) , y3 - y2 ) ; result [ 3 ] = new RectShape ( bar . getMinX ( ) , y3 , bar . getWidth ( ) , bar . getMaxY ( ) - y3 ) ; 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 ) .