afreechart/src/main/java/org/afree/chart/plot/CombinedDomainXYPlot.java
/**
     * Draws the plot within the specified area on a graphics device.
     *
     * @param canvas  the graphics device.
     * @param area  the plot area (in Java2D space).
     * @param anchor  an anchor point in Java2D space (<code>null</code>
     *                permitted).
     * @param parentState  the state from the parent plot, if there is one
     *                     (<code>null</code> permitted).
     * @param info  collects chart drawing information (<code>null</code>
     *              permitted).
     */
Draws the plot within the specified area on a graphics device.
@param canvas  the graphics device.
@param area  the plot area (in Java2D space).
@param anchor  an anchor point in Java2D space (null
permitted).
@param parentState  the state from the parent plot, if there is one
(null permitted).
@param info  collects chart drawing information (null
permitted).
Draws the plot within the specified area on a graphics device . @param canvas the graphics device . @param area the plot area ( in Java2D space ) . @param anchor an anchor point in Java2D space ( null permitted ) . @param parentState the state from the parent plot if there is one ( null permitted ) . @param info collects chart drawing information ( null permitted ) .
public void draw(Canvas canvas,
                     RectShape area,
                     PointF anchor,
                     PlotState parentState,
                     PlotRenderingInfo info) {
        if (info != null) {
            info.setPlotArea(area);
        }
        RectangleInsets insets = getInsets();
        insets.trim(area);
        setFixedRangeAxisSpaceForSubplots(null);
        AxisSpace space = calculateAxisSpace(canvas, area);
        RectShape dataArea = space.shrink(area, null);
        setFixedRangeAxisSpaceForSubplots(space);
        ValueAxis axis = getDomainAxis();
        RectangleEdge edge = getDomainAxisEdge();
        double cursor = RectangleEdge.coordinate(dataArea, edge);
        AxisState axisState = axis.draw(canvas, cursor, area, dataArea, edge, info);
        if (parentState == null) {
            parentState = new PlotState();
        }
        parentState.getSharedAxisStates().put(axis, axisState);
        for (int i = 0; i < this.subplots.size(); i++) {
            XYPlot plot = (XYPlot) this.subplots.get(i);
            PlotRenderingInfo subplotInfo = null;
            if (info != null) {
                subplotInfo = new PlotRenderingInfo(info.getOwner());
                info.addSubplotInfo(subplotInfo);
            }
            plot.draw(canvas, this.subplotAreas[i], anchor, parentState,
                    subplotInfo);
        }
        if (info != null) {
            info.setDataArea(dataArea);
        }
    }
public void draw ( Canvas canvas , RectShape area , PointF anchor , PlotState parentState , PlotRenderingInfo info ) { if ( info != null ) { info . setPlotArea ( area ) ; } RectangleInsets insets = getInsets ( ) ; insets . trim ( area ) ; setFixedRangeAxisSpaceForSubplots ( null ) ; AxisSpace space = calculateAxisSpace ( canvas , area ) ; RectShape dataArea = space . shrink ( area , null ) ; setFixedRangeAxisSpaceForSubplots ( space ) ; ValueAxis axis = getDomainAxis ( ) ; RectangleEdge edge = getDomainAxisEdge ( ) ; double cursor = RectangleEdge . coordinate ( dataArea , edge ) ; AxisState axisState = axis . draw ( canvas , cursor , area , dataArea , edge , info ) ; if ( parentState == null ) { parentState = new PlotState ( ) ; } parentState . getSharedAxisStates ( ) . put ( axis , axisState ) ; for ( int i = 0 ; i < this . subplots . size ( ) ; i ++ ) { XYPlot plot = ( XYPlot ) this . subplots . get ( i ) ; PlotRenderingInfo subplotInfo = null ; if ( info != null ) { subplotInfo = new PlotRenderingInfo ( info . getOwner ( ) ) ; info . addSubplotInfo ( subplotInfo ) ; } plot . draw ( canvas , this . subplotAreas [ i ] , anchor , parentState , subplotInfo ) ; } if ( info != null ) { info . setDataArea ( dataArea ) ; } }
Draws the plot within the specified area on a graphics device.
Draws the plot within the specified area on a graphics device .
// set up info collection... // adjust the drawing area for plot insets (if any)... // set the width and height of non-shared axis of all sub-plots // draw the shared axis // draw all the subplots