Java Code Examples for org.jfree.chart.axis.ValueAxis#java2DToValue()

The following examples show how to use org.jfree.chart.axis.ValueAxis#java2DToValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XYPlot.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 *
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
@Override
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {

    // perform the zoom on each range axis
    for (ValueAxis yAxis : this.rangeAxes.values()) {
        if (yAxis == null) {
            continue;
        }
        if (useAnchor) {
            // get the relevant source coordinate given the plot orientation
            double sourceY = source.getY();
            if (this.orientation == PlotOrientation.HORIZONTAL) {
                sourceY = source.getX();
            }
            double anchorY = yAxis.java2DToValue(sourceY,
                    info.getDataArea(), getRangeAxisEdge());
            yAxis.resizeRange2(factor, anchorY);
        } else {
            yAxis.resizeRange(factor);
        }
    }
}
 
Example 2
Source File: XYPlot.java    From ccu-historian with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 *
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
@Override
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {

    // perform the zoom on each range axis
    for (ValueAxis yAxis : this.rangeAxes.values()) {
        if (yAxis == null) {
            continue;
        }
        if (useAnchor) {
            // get the relevant source coordinate given the plot orientation
            double sourceY = source.getY();
            if (this.orientation == PlotOrientation.HORIZONTAL) {
                sourceY = source.getX();
            }
            double anchorY = yAxis.java2DToValue(sourceY,
                    info.getDataArea(), getRangeAxisEdge());
            yAxis.resizeRange2(factor, anchorY);
        } else {
            yAxis.resizeRange(factor);
        }
    }
}
 
Example 3
Source File: Chart_14_XYPlot_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 * 
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 * 
 * @since 1.0.7
 */
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {
            
    // perform the zoom on each range axis
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
        if (rangeAxis != null) {
            if (useAnchor) {
                // get the relevant source coordinate given the plot 
                // orientation
                double sourceY = source.getY();
                if (this.orientation == PlotOrientation.HORIZONTAL) {
                    sourceY = source.getX();
                }
                double anchorY = rangeAxis.java2DToValue(sourceY, 
                        info.getDataArea(), getRangeAxisEdge());
                rangeAxis.resizeRange(factor, anchorY);
            }
            else {
                rangeAxis.resizeRange(factor);
            }
        }
    }
}
 
Example 4
Source File: XYPlot.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Handles a 'click' on the plot by updating the anchor values.
 *
 * @param x  the x-coordinate, where the click occurred, in Java2D space.
 * @param y  the y-coordinate, where the click occurred, in Java2D space.
 * @param info  object containing information about the plot dimensions.
 */
@Override
public void handleClick(int x, int y, PlotRenderingInfo info) {

    Rectangle2D dataArea = info.getDataArea();
    if (dataArea.contains(x, y)) {
        // set the anchor value for the horizontal axis...
        ValueAxis xaxis = getDomainAxis();
        if (xaxis != null) {
            double hvalue = xaxis.java2DToValue(x, info.getDataArea(),
                    getDomainAxisEdge());
            setDomainCrosshairValue(hvalue);
        }

        // set the anchor value for the vertical axis...
        ValueAxis yaxis = getRangeAxis();
        if (yaxis != null) {
            double vvalue = yaxis.java2DToValue(y, info.getDataArea(),
                    getRangeAxisEdge());
            setRangeCrosshairValue(vvalue);
        }
    }
}
 
Example 5
Source File: Chart_19_CategoryPlot_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 * 
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 * 
 * @since 1.0.7
 */
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {
            
    // perform the zoom on each range axis
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
        if (rangeAxis != null) {
            if (useAnchor) {
                // get the relevant source coordinate given the plot 
                // orientation
                double sourceY = source.getY();
                if (this.orientation == PlotOrientation.HORIZONTAL) {
                    sourceY = source.getX();
                }
                double anchorY = rangeAxis.java2DToValue(sourceY, 
                        info.getDataArea(), getRangeAxisEdge());
                rangeAxis.resizeRange(factor, anchorY);
            }
            else {
                rangeAxis.resizeRange(factor);
            }
        }
    }
}
 
Example 6
Source File: Chart_14_CategoryPlot_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 * 
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 * 
 * @since 1.0.7
 */
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {
            
    // perform the zoom on each range axis
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
        if (rangeAxis != null) {
            if (useAnchor) {
                // get the relevant source coordinate given the plot 
                // orientation
                double sourceY = source.getY();
                if (this.orientation == PlotOrientation.HORIZONTAL) {
                    sourceY = source.getX();
                }
                double anchorY = rangeAxis.java2DToValue(sourceY, 
                        info.getDataArea(), getRangeAxisEdge());
                rangeAxis.resizeRange(factor, anchorY);
            }
            else {
                rangeAxis.resizeRange(factor);
            }
        }
    }
}
 
Example 7
Source File: XYPlot.java    From SIMVA-SoS with Apache License 2.0 6 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 *
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
@Override
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {

    // perform the zoom on each range axis
    for (ValueAxis yAxis : this.rangeAxes.values()) {
        if (yAxis == null) {
            continue;
        }
        if (useAnchor) {
            // get the relevant source coordinate given the plot orientation
            double sourceY = source.getY();
            if (this.orientation == PlotOrientation.HORIZONTAL) {
                sourceY = source.getX();
            }
            double anchorY = yAxis.java2DToValue(sourceY,
                    info.getDataArea(), getRangeAxisEdge());
            yAxis.resizeRange2(factor, anchorY);
        } else {
            yAxis.resizeRange(factor);
        }
    }
}
 
Example 8
Source File: 1_XYPlot.java    From SimFix with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 * 
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 * 
 * @since 1.0.7
 */
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {
            
    // perform the zoom on each range axis
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
        if (rangeAxis != null) {
            if (useAnchor) {
                // get the relevant source coordinate given the plot 
                // orientation
                double sourceY = source.getY();
                if (this.orientation == PlotOrientation.HORIZONTAL) {
                    sourceY = source.getX();
                }
                double anchorY = rangeAxis.java2DToValue(sourceY, 
                        info.getDataArea(), getRangeAxisEdge());
                rangeAxis.resizeRange(factor, anchorY);
            }
            else {
                rangeAxis.resizeRange(factor);
            }
        }
    }
}
 
Example 9
Source File: CategoryPlot.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 *
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
@Override
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {

    // perform the zoom on each range axis
    for (ValueAxis rangeAxis : this.rangeAxes.values()) {
        if (rangeAxis == null) {
            continue;
        }
        if (useAnchor) {
            // get the relevant source coordinate given the plot orientation
            double sourceY = source.getY();
            if (this.orientation.isHorizontal()) {
                sourceY = source.getX();
            }
            double anchorY = rangeAxis.java2DToValue(sourceY,
                    info.getDataArea(), getRangeAxisEdge());
            rangeAxis.resizeRange2(factor, anchorY);
        } else {
            rangeAxis.resizeRange(factor);
        }
    }
}
 
Example 10
Source File: 1_XYPlot.java    From SimFix with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Handles a 'click' on the plot by updating the anchor values.
 *
 * @param x  the x-coordinate, where the click occurred, in Java2D space.
 * @param y  the y-coordinate, where the click occurred, in Java2D space.
 * @param info  object containing information about the plot dimensions.
 */
public void handleClick(int x, int y, PlotRenderingInfo info) {

    Rectangle2D dataArea = info.getDataArea();
    if (dataArea.contains(x, y)) {
        // set the anchor value for the horizontal axis...
        ValueAxis da = getDomainAxis();
        if (da != null) {
            double hvalue = da.java2DToValue(x, info.getDataArea(), 
                    getDomainAxisEdge());
            setDomainCrosshairValue(hvalue);
        }

        // set the anchor value for the vertical axis...
        ValueAxis ra = getRangeAxis();
        if (ra != null) {
            double vvalue = ra.java2DToValue(y, info.getDataArea(), 
                    getRangeAxisEdge());
            setRangeCrosshairValue(vvalue);
        }
    }
}
 
Example 11
Source File: PolarPlot.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Multiplies the range on the range axis by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point (in Java2D space).
 * @param useAnchor  use source point as zoom anchor?
 *
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
@Override
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {
    // get the source coordinate - this plot has always a VERTICAL
    // orientation
    final double sourceX = source.getX();

    for (int axisIdx = 0; axisIdx < getAxisCount(); axisIdx++) {
        final ValueAxis axis = getAxis(axisIdx);
        if (axis != null) {
            if (useAnchor) {
                double anchorX = axis.java2DToValue(sourceX,
                        info.getDataArea(), RectangleEdge.BOTTOM);
                axis.resizeRange(factor, anchorX);
            }
            else {
                axis.resizeRange(factor);
            }
        }
    }
}
 
Example 12
Source File: Chart_14_CategoryPlot_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 * 
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 * 
 * @since 1.0.7
 */
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {
            
    // perform the zoom on each range axis
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
        if (rangeAxis != null) {
            if (useAnchor) {
                // get the relevant source coordinate given the plot 
                // orientation
                double sourceY = source.getY();
                if (this.orientation == PlotOrientation.HORIZONTAL) {
                    sourceY = source.getX();
                }
                double anchorY = rangeAxis.java2DToValue(sourceY, 
                        info.getDataArea(), getRangeAxisEdge());
                rangeAxis.resizeRange(factor, anchorY);
            }
            else {
                rangeAxis.resizeRange(factor);
            }
        }
    }
}
 
Example 13
Source File: XYPlot.java    From SIMVA-SoS with Apache License 2.0 6 votes vote down vote up
/**
 * Handles a 'click' on the plot by updating the anchor values.
 *
 * @param x  the x-coordinate, where the click occurred, in Java2D space.
 * @param y  the y-coordinate, where the click occurred, in Java2D space.
 * @param info  object containing information about the plot dimensions.
 */
@Override
public void handleClick(int x, int y, PlotRenderingInfo info) {

    Rectangle2D dataArea = info.getDataArea();
    if (dataArea.contains(x, y)) {
        // set the anchor value for the horizontal axis...
        ValueAxis xaxis = getDomainAxis();
        if (xaxis != null) {
            double hvalue = xaxis.java2DToValue(x, info.getDataArea(),
                    getDomainAxisEdge());
            setDomainCrosshairValue(hvalue);
        }

        // set the anchor value for the vertical axis...
        ValueAxis yaxis = getRangeAxis();
        if (yaxis != null) {
            double vvalue = yaxis.java2DToValue(y, info.getDataArea(),
                    getRangeAxisEdge());
            setRangeCrosshairValue(vvalue);
        }
    }
}
 
Example 14
Source File: CategoryPlot.java    From SIMVA-SoS with Apache License 2.0 6 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 *
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
@Override
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {

    // perform the zoom on each range axis
    for (ValueAxis rangeAxis : this.rangeAxes.values()) {
        if (rangeAxis == null) {
            continue;
        }
        if (useAnchor) {
            // get the relevant source coordinate given the plot orientation
            double sourceY = source.getY();
            if (this.orientation.isHorizontal()) {
                sourceY = source.getX();
            }
            double anchorY = rangeAxis.java2DToValue(sourceY,
                    info.getDataArea(), getRangeAxisEdge());
            rangeAxis.resizeRange2(factor, anchorY);
        } else {
            rangeAxis.resizeRange(factor);
        }
    }
}
 
Example 15
Source File: Cardumen_0082_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 *
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {

    // perform the zoom on each range axis
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
        if (rangeAxis != null) {
            if (useAnchor) {
                // get the relevant source coordinate given the plot
                // orientation
                double sourceY = source.getY();
                if (this.orientation == PlotOrientation.HORIZONTAL) {
                    sourceY = source.getX();
                }
                double anchorY = rangeAxis.java2DToValue(sourceY,
                        info.getDataArea(), getRangeAxisEdge());
                rangeAxis.resizeRange2(factor, anchorY);
            }
            else {
                rangeAxis.resizeRange(factor);
            }
        }
    }
}
 
Example 16
Source File: PolarPlot.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Multiplies the range on the range axis by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point (in Java2D space).
 * @param useAnchor  use source point as zoom anchor?
 *
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
@Override
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {
    // get the source coordinate - this plot has always a VERTICAL
    // orientation
    final double sourceX = source.getX();

    for (int axisIdx = 0; axisIdx < getAxisCount(); axisIdx++) {
        final ValueAxis axis = getAxis(axisIdx);
        if (axis != null) {
            if (useAnchor) {
                double anchorX = axis.java2DToValue(sourceX,
                        info.getDataArea(), RectangleEdge.BOTTOM);
                axis.resizeRange(factor, anchorX);
            }
            else {
                axis.resizeRange(factor);
            }
        }
    }
}
 
Example 17
Source File: XYPlot.java    From SIMVA-SoS with Apache License 2.0 6 votes vote down vote up
/**
 * Multiplies the range on the domain axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point (in Java2D space).
 * @param useAnchor  use source point as zoom anchor?
 *
 * @see #zoomRangeAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
@Override
public void zoomDomainAxes(double factor, PlotRenderingInfo info,
                           Point2D source, boolean useAnchor) {

    // perform the zoom on each domain axis
    for (ValueAxis xAxis : this.domainAxes.values()) {
        if (xAxis == null) {
            continue;
        }
        if (useAnchor) {
            // get the relevant source coordinate given the plot orientation
            double sourceX = source.getX();
            if (this.orientation == PlotOrientation.HORIZONTAL) {
                sourceX = source.getY();
            }
            double anchorX = xAxis.java2DToValue(sourceX,
                    info.getDataArea(), getDomainAxisEdge());
            xAxis.resizeRange2(factor, anchorX);
        } else {
            xAxis.resizeRange(factor);
        }
    }
}
 
Example 18
Source File: XYPlot.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Multiplies the range on the domain axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point (in Java2D space).
 * @param useAnchor  use source point as zoom anchor?
 *
 * @see #zoomRangeAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
@Override
public void zoomDomainAxes(double factor, PlotRenderingInfo info,
                           Point2D source, boolean useAnchor) {

    // perform the zoom on each domain axis
    for (ValueAxis xAxis : this.domainAxes.values()) {
        if (xAxis == null) {
            continue;
        }
        if (useAnchor) {
            // get the relevant source coordinate given the plot orientation
            double sourceX = source.getX();
            if (this.orientation == PlotOrientation.HORIZONTAL) {
                sourceX = source.getY();
            }
            double anchorX = xAxis.java2DToValue(sourceX,
                    info.getDataArea(), getDomainAxisEdge());
            xAxis.resizeRange2(factor, anchorX);
        } else {
            xAxis.resizeRange(factor);
        }
    }
}
 
Example 19
Source File: XYPlot.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Handles a 'click' on the plot by updating the anchor values.
 *
 * @param x  the x-coordinate, where the click occurred, in Java2D space.
 * @param y  the y-coordinate, where the click occurred, in Java2D space.
 * @param info  object containing information about the plot dimensions.
 */
@Override
public void handleClick(int x, int y, PlotRenderingInfo info) {

    Rectangle2D dataArea = info.getDataArea();
    if (dataArea.contains(x, y)) {
        // set the anchor value for the horizontal axis...
        ValueAxis xaxis = getDomainAxis();
        if (xaxis != null) {
            double hvalue = xaxis.java2DToValue(x, info.getDataArea(),
                    getDomainAxisEdge());
            setDomainCrosshairValue(hvalue);
        }

        // set the anchor value for the vertical axis...
        ValueAxis yaxis = getRangeAxis();
        if (yaxis != null) {
            double vvalue = yaxis.java2DToValue(y, info.getDataArea(),
                    getRangeAxisEdge());
            setRangeCrosshairValue(vvalue);
        }
    }
}
 
Example 20
Source File: Cardumen_0082_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Converts a path from Java2D space to data space.
 *
 * @param path  the path (<code>null</code> not permitted).
 * @param dataArea  the data area.
 * @param dataset  the dataset which can be used to find the appropriate
 *         axes.
 *
 * @return A path in data space.
 */
private GeneralPath convertToDataSpace(GeneralPath path,
        Rectangle2D dataArea, XYDataset dataset) {
    GeneralPath result = new GeneralPath(path.getWindingRule());
    int datasetIndex = indexOf(dataset);
    ValueAxis xAxis = getDomainAxisForDataset(datasetIndex);
    ValueAxis yAxis = getRangeAxisForDataset(datasetIndex);
    RectangleEdge xAxisEdge = getDomainAxisEdge();
    RectangleEdge yAxisEdge = getRangeAxisEdge();
    double[] coords = new double[6];
    PathIterator iterator = path.getPathIterator(null);
    while (!iterator.isDone()) {
        int segType = iterator.currentSegment(coords);
        double xx = xAxis.java2DToValue(coords[0], dataArea, xAxisEdge);
        double yy = yAxis.java2DToValue(coords[1], dataArea, yAxisEdge);
        if (segType == PathIterator.SEG_MOVETO) {
            result.moveTo((float) xx, (float) yy);
        }
        else if (segType == PathIterator.SEG_LINETO) {
            result.lineTo((float) xx, (float) yy);
        }
        else if (segType == PathIterator.SEG_CLOSE) {
            result.closePath();
        }
        iterator.next();
    }
    return result;
}