Example usage for org.jfree.chart.axis ValueAxis valueToJava2D

List of usage examples for org.jfree.chart.axis ValueAxis valueToJava2D

Introduction

In this page you can find the example usage for org.jfree.chart.axis ValueAxis valueToJava2D.

Prototype

public abstract double valueToJava2D(double value, Rectangle2D area, RectangleEdge edge);

Source Link

Document

Converts a data value to a coordinate in Java2D space, assuming that the axis runs along one edge of the specified dataArea.

Usage

From source file:com.lfx.web.WebChartXYPlot.java

/**
  * Draws the gridlines for the plot, if they are visible.
  *//from   ww  w.ja va  2 s .  c  o  m
  * @param g2  the graphics device.
  * @param dataArea  the data area.
  * @param ticks  the ticks.
  *
  * @see #drawRangeGridlines(Graphics2D, Rectangle2D, List)
  */

protected void drawRangeGridlines(Graphics2D g2, Rectangle2D dataArea, List ticks) {
    Composite oldcomp = g2.getComposite();
    Paint bandPaint = getBackgroundPaint();
    if (bandPaint != null && bandPaint instanceof java.awt.Color) {
        // g2.setComposite(AlphaComposite.SrcO);
        java.awt.Color bandcolor = (java.awt.Color) (bandPaint);
        boolean fillBand = false;
        ValueAxis axis = getRangeAxis();
        double previous = axis.getLowerBound();
        Iterator iterator = ticks.iterator();
        while (iterator.hasNext()) {
            ValueTick tick = (ValueTick) iterator.next();
            if (!tick.getTickType().equals(TickType.MAJOR))
                continue;
            double current = tick.getValue();
            double y1 = axis.valueToJava2D(previous, dataArea, getRangeAxisEdge());
            double y2 = axis.valueToJava2D(current, dataArea, getRangeAxisEdge());
            Rectangle2D band = new Rectangle2D.Double(dataArea.getMinX(), y2, dataArea.getWidth(), y1 - y2);
            if (fillBand)
                g2.setPaint(bandcolor);
            else
                g2.setPaint(bandcolor.darker());
            g2.fill(band);
            previous = current;
            fillBand = !fillBand;
        }
        double end = axis.getUpperBound();
        double y1 = axis.valueToJava2D(previous, dataArea, getRangeAxisEdge());
        double y2 = axis.valueToJava2D(end, dataArea, getRangeAxisEdge());
        Rectangle2D band = new Rectangle2D.Double(dataArea.getMinX(), y2, dataArea.getWidth(), y1 - y2);
        if (fillBand)
            g2.setPaint(bandcolor);
        else
            g2.setPaint(bandcolor.darker());
        g2.fill(band);
    } else {
        super.drawRangeGridlines(g2, dataArea, ticks);
    }
    g2.setComposite(oldcomp);
}

From source file:com.lfx.web.WebChartXYPlot.java

/**
 * Draws the gridlines for the plot's primary range axis, if they are
 * visible.//w ww.ja v  a  2 s . co m
 *
 * @param g2  the graphics device.
 * @param area  the data area.
 * @param ticks  the ticks.
 *
 * @see #drawDomainGridlines(Graphics2D, Rectangle2D, List)
 */
protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea, List ticks) {
    Composite oldcomp = g2.getComposite();
    Paint bandPaint = getBackgroundPaint();
    if (bandPaint != null && bandPaint instanceof java.awt.Color) {
        g2.setComposite(AlphaComposite.SrcIn);
        java.awt.Color bandcolor = (java.awt.Color) (bandPaint);
        boolean fillBand = true;
        ValueAxis axis = getDomainAxis();
        double previous = axis.getLowerBound();
        Iterator iterator = ticks.iterator();
        while (iterator.hasNext()) {
            ValueTick tick = (ValueTick) iterator.next();
            if (!tick.getTickType().equals(TickType.MAJOR))
                continue;
            double current = tick.getValue();
            double y1 = axis.valueToJava2D(previous, dataArea, getDomainAxisEdge());
            double y2 = axis.valueToJava2D(current, dataArea, getDomainAxisEdge());
            Rectangle2D band = new Rectangle2D.Double(y1, dataArea.getMinY(), y2 - y1, dataArea.getWidth());
            if (fillBand)
                g2.setPaint(bandcolor);
            else
                g2.setPaint(bandcolor.darker());
            g2.fill(band);
            previous = current;
            fillBand = !fillBand;
        }
        double end = axis.getUpperBound();
        double y1 = axis.valueToJava2D(previous, dataArea, getDomainAxisEdge());
        double y2 = axis.valueToJava2D(end, dataArea, getDomainAxisEdge());
        Rectangle2D band = new Rectangle2D.Double(y1, dataArea.getMinY(), y2 - y1, dataArea.getWidth());
        if (fillBand)
            g2.setPaint(bandcolor);
        else
            g2.setPaint(bandcolor.darker());
        g2.fill(band);
    } else {
        super.drawDomainGridlines(g2, dataArea, ticks);
    }
    g2.setComposite(oldcomp);
}

From source file:no.met.jtimeseries.chart.XYCloudSymbolRenderer.java

/**
 * Draws the visual representation of a single symbol.
 *//*from  w ww  . ja v a  2  s.co  m*/
@Override
public void drawItem(Graphics2D g2d, XYItemRendererState state, Rectangle2D plotArea, PlotRenderingInfo info,
        XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item,
        CrosshairState crosshairState, int pass) {
    // Needs a new graphics object to use translate() and rotate()
    Graphics2D g2 = (Graphics2D) g2d.create();
    g2.setRenderingHints(renderHints);

    double middleY = plotArea.getCenterY();
    CloudDataset cloudData = (CloudDataset) dataset;
    Number x = cloudData.getX(series, item);
    double middleX = domainAxis.valueToJava2D(x.doubleValue(), plotArea, plot.getDomainAxisEdge());
    g2.translate((int) middleX, (int) middleY); // make x=0, y=0 the middle of the symbol
    g2.setStroke(new BasicStroke());
    double height = plotArea.getHeight() - 2;

    // we set the width to be 20 which is the same as the weather symbols 
    double width = calculateWidth(plotArea.getWidth());
    double startX = -(width / 2);
    double startY[] = { -(height / 2), -(height / 4), 0, (height / 4) };
    double values[] = { (cloudData.getHighClouds(series, item).doubleValue() / 100.0),
            (cloudData.getMediumClouds(series, item).doubleValue() / 100.0),
            (cloudData.getLowClouds(series, item).doubleValue() / 100.0),
            (cloudData.getFog(series, item).doubleValue() / 100.0) };

    for (int i = 0; i < values.length; i++) { // for each cloud type
        g2.setColor(new Color(96, 96, 96));
        g2.fill(new Rectangle2D.Double(startX, startY[i], (width * values[i]), (height / 4 - 1))); // plot could
        g2.setColor(new Color(97, 204, 247));
        g2.fill(new Rectangle2D.Double(startX + (width * values[i]), startY[i], (width * (1 - values[i])),
                (height / 4 - 1))); // plot sky
    }
}

From source file:com.epiq.bitshark.ui.FrequencyDomainMouseMarker.java

/**
 * Draws the annotation.//  ww  w.  j  a v a2 s  .  c  o m
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param rendererIndex  the renderer index.
 * @param info  if supplied, this info object will be populated with
 *              entity information.
 */
@Override
public void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis,
        int rendererIndex, PlotRenderingInfo info) {

    if (!visible) {
        return;
    }

    PlotOrientation orientation = plot.getOrientation();
    RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(plot.getDomainAxisLocation(), orientation);
    RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(plot.getRangeAxisLocation(), orientation);
    float j2DX = (float) domainAxis.valueToJava2D(this.x, dataArea, domainEdge);
    float j2DY = (float) rangeAxis.valueToJava2D(this.y, dataArea, rangeEdge);
    Rectangle2D displayArea = new Rectangle2D.Double(j2DX - this.displayWidth / 2.0,
            j2DY - this.displayHeight / 2.0, this.displayWidth, this.displayHeight);

    // here we change the AffineTransform so we can draw the annotation
    // to a larger area and scale it down into the display area
    // afterwards, the original transform is restored
    AffineTransform savedTransform = g2.getTransform();
    Rectangle2D drawArea = new Rectangle2D.Double(0.0, 0.0, this.displayWidth * this.drawScaleFactor,
            this.displayHeight * this.drawScaleFactor);

    g2.scale(1 / this.drawScaleFactor, 1 / this.drawScaleFactor);
    g2.translate((j2DX - this.displayWidth / 2.0) * this.drawScaleFactor,
            (j2DY - this.displayHeight / 2.0) * this.drawScaleFactor);
    draw(g2, drawArea);
    g2.setTransform(savedTransform);
    String toolTip = getToolTipText();
    String url = getURL();
    if (toolTip != null || url != null) {
        addEntity(info, displayArea, rendererIndex, toolTip, url);
    }

}

From source file:org.mwc.cmap.grideditor.chart.RendererWithDynamicFeedback.java

/**
 * All parameters are domain coordinates that have to be translated to
 * Java2D points.//from ww  w .ja  v  a2 s  . c om
 */
private void drawFeedbackEdge(final double x0, final double y0, final double x1, final double y1,
        final XYItemRendererState state, final Graphics2D g2, final XYPlot plot, final ValueAxis domainAxis,
        final ValueAxis rangeAxis, final Rectangle2D dataArea) {
    if (Double.isNaN(y0) || Double.isNaN(x0) || Double.isNaN(y1) || Double.isNaN(x1)) {
        return;
    }

    final RectangleEdge xAxisLocation = plot.getDomainAxisEdge();
    final RectangleEdge yAxisLocation = plot.getRangeAxisEdge();

    final double transX0 = domainAxis.valueToJava2D(x0, dataArea, xAxisLocation);
    final double transY0 = rangeAxis.valueToJava2D(y0, dataArea, yAxisLocation);

    final double transX1 = domainAxis.valueToJava2D(x1, dataArea, xAxisLocation);
    final double transY1 = rangeAxis.valueToJava2D(y1, dataArea, yAxisLocation);

    // only draw if we have good values
    if (Double.isNaN(transX0) || Double.isNaN(transY0) || Double.isNaN(transX1) || Double.isNaN(transY1)) {
        return;
    }

    final PlotOrientation orientation = plot.getOrientation();
    if (orientation == PlotOrientation.HORIZONTAL) {
        state.workingLine.setLine(transY0, transX0, transY1, transX1);
    } else if (orientation == PlotOrientation.VERTICAL) {
        state.workingLine.setLine(transX0, transY0, transX1, transY1);
    }

    if (state.workingLine.intersects(dataArea)) {
        g2.setStroke(getFeedbackStroke());
        g2.setPaint(getFeedbackEdgePaint());
        g2.draw(state.workingLine);
    }

}

From source file:org.openaltimeter.desktopapp.annotations.XYVarioAnnotation.java

@Override
public void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis,
        int rendererIndex, PlotRenderingInfo info) {
    // draw line//from   w w  w .j  a  v a2 s  . co m
    super.draw(g2, plot, dataArea, domainAxis, rangeAxis, rendererIndex, info);

    // draw text
    PlotOrientation orientation = plot.getOrientation();
    RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(plot.getDomainAxisLocation(), orientation);
    RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(plot.getRangeAxisLocation(), orientation);

    float anchorX = (float) domainAxis.valueToJava2D((x1 + x2) / 2, dataArea, domainEdge);
    float anchorY = (float) rangeAxis.valueToJava2D((y1 + y2) / 2, dataArea, rangeEdge);

    if (orientation == PlotOrientation.HORIZONTAL) {
        float tempAnchor = anchorX;
        anchorX = anchorY;
        anchorY = tempAnchor;
    }

    g2.setFont(getFont());
    g2.setPaint(getPaint());

    TextUtilities.drawRotatedString(getText(), g2, anchorX + this.offset, anchorY - OFFSET_SIZE,
            getTextAnchor(), getRotationAngle(), getRotationAnchor());

    g2.setPaint(Color.GRAY);
    int jx1 = (int) domainAxis.valueToJava2D(x1, dataArea, domainEdge);
    int jx2 = (int) domainAxis.valueToJava2D(x2, dataArea, domainEdge);
    int jy1 = (int) rangeAxis.valueToJava2D(y1, dataArea, rangeEdge);
    int jy2 = (int) rangeAxis.valueToJava2D(y2, dataArea, rangeEdge);

    TextUtilities.drawRotatedString(getText2(), g2, (jx1 + jx2) / 2, jy1 + LIMB_TEXT_OFFSET, getTextAnchor(),
            getRotationAngle(), getRotationAnchor());

    g2.drawLine(jx1, jy1, jx2, jy1);
    g2.drawLine(jx2, jy1, jx2, jy2);

}

From source file:com.android.ddmuilib.log.event.OccurrenceRenderer.java

@Override
public void drawItem(Graphics2D g2, XYItemRendererState state, Rectangle2D dataArea, PlotRenderingInfo info,
        XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item,
        CrosshairState crosshairState, int pass) {
    TimeSeriesCollection timeDataSet = (TimeSeriesCollection) dataset;

    // get the x value for the series/item.
    double x = timeDataSet.getX(series, item).doubleValue();

    // get the min/max of the range axis
    double yMin = rangeAxis.getLowerBound();
    double yMax = rangeAxis.getUpperBound();

    RectangleEdge domainEdge = plot.getDomainAxisEdge();
    RectangleEdge rangeEdge = plot.getRangeAxisEdge();

    // convert the coordinates to java2d.
    double x2D = domainAxis.valueToJava2D(x, dataArea, domainEdge);
    double yMin2D = rangeAxis.valueToJava2D(yMin, dataArea, rangeEdge);
    double yMax2D = rangeAxis.valueToJava2D(yMax, dataArea, rangeEdge);

    // get the paint information for the series/item
    Paint p = getItemPaint(series, item);
    Stroke s = getItemStroke(series, item);

    Line2D line = null;/*  www  . j a v  a 2 s .c  o m*/
    PlotOrientation orientation = plot.getOrientation();
    if (orientation == PlotOrientation.HORIZONTAL) {
        line = new Line2D.Double(yMin2D, x2D, yMax2D, x2D);
    } else if (orientation == PlotOrientation.VERTICAL) {
        line = new Line2D.Double(x2D, yMin2D, x2D, yMax2D);
    }
    g2.setPaint(p);
    g2.setStroke(s);
    g2.draw(line);
}

From source file:org.jfree.chart.demo.GanttRenderer2.java

protected void drawTask(Graphics2D graphics2d, CategoryItemRendererState categoryitemrendererstate,
        Rectangle2D rectangle2d, CategoryPlot categoryplot, CategoryAxis categoryaxis, ValueAxis valueaxis,
        GanttCategoryDataset ganttcategorydataset, int i, int j) {
    PlotOrientation plotorientation = categoryplot.getOrientation();
    org.jfree.ui.RectangleEdge rectangleedge = categoryplot.getRangeAxisEdge();
    Number number = ganttcategorydataset.getEndValue(i, j);
    if (number == null)
        return;//from w  ww  . jav  a2  s .com
    double d = valueaxis.valueToJava2D(number.doubleValue(), rectangle2d, rectangleedge);
    Number number1 = ganttcategorydataset.getStartValue(i, j);
    if (number1 == null)
        return;
    double d1 = valueaxis.valueToJava2D(number1.doubleValue(), rectangle2d, rectangleedge);
    if (d1 < d) {
        double d2 = d1;
        d1 = d;
        d = d2;
        Number number2 = number1;
        number1 = number;
        number = number2;
    }
    int k = countNonNullValues(ganttcategorydataset, j);
    if (k == 0)
        return;
    int l = countPriorNonNullValues(ganttcategorydataset, j, i);
    double d3 = (categoryaxis.getCategoryEnd(j, getColumnCount(), rectangle2d, categoryplot.getDomainAxisEdge())
            - categoryaxis.getCategoryStart(j, getColumnCount(), rectangle2d, categoryplot.getDomainAxisEdge()))
            / (double) k;
    double d4 = categoryaxis.getCategoryStart(j, getColumnCount(), rectangle2d,
            categoryplot.getDomainAxisEdge()) + d3 * (double) l;
    double d5 = Math.abs(d1 - d);
    java.awt.geom.Rectangle2D.Double double1 = null;
    if (plotorientation == PlotOrientation.HORIZONTAL)
        double1 = new java.awt.geom.Rectangle2D.Double(d, d4, d5, d3);
    else if (plotorientation == PlotOrientation.VERTICAL)
        double1 = new java.awt.geom.Rectangle2D.Double(d4, d1, d3, d5);
    java.awt.geom.Rectangle2D.Double double2 = null;
    java.awt.geom.Rectangle2D.Double double3 = null;
    Number number3 = ganttcategorydataset.getPercentComplete(i, j);
    double d6 = getStartPercent();
    double d7 = getEndPercent();
    if (number3 != null) {
        double d8 = number3.doubleValue();
        if (categoryplot.getOrientation() == PlotOrientation.HORIZONTAL) {
            double2 = new java.awt.geom.Rectangle2D.Double(d, d4 + d6 * d3, d5 * d8, d3 * (d7 - d6));
            double3 = new java.awt.geom.Rectangle2D.Double(d + d5 * d8, d4 + d6 * d3, d5 * (1.0D - d8),
                    d3 * (d7 - d6));
        } else if (categoryplot.getOrientation() == PlotOrientation.VERTICAL) {
            double2 = new java.awt.geom.Rectangle2D.Double(d4 + d6 * d3, d1 + d5 * (1.0D - d8), d3 * (d7 - d6),
                    d5 * d8);
            double3 = new java.awt.geom.Rectangle2D.Double(d4 + d6 * d3, d1, d3 * (d7 - d6), d5 * (1.0D - d8));
        }
    }
    Paint paint = getItemPaint(i, j);
    graphics2d.setPaint(paint);
    graphics2d.fill(double1);
    if (double2 != null) {
        graphics2d.setPaint(getCompletePaint());
        graphics2d.fill(double2);
    }
    if (double3 != null) {
        graphics2d.setPaint(getIncompletePaint());
        graphics2d.fill(double3);
    }
    if (isDrawBarOutline() && categoryitemrendererstate.getBarWidth() > 3D) {
        java.awt.Stroke stroke = getItemOutlineStroke(i, j);
        Paint paint1 = getItemOutlinePaint(i, j);
        if (stroke != null && paint1 != null) {
            graphics2d.setStroke(stroke);
            graphics2d.setPaint(paint1);
            graphics2d.draw(double1);
        }
    }
    org.jfree.chart.labels.CategoryItemLabelGenerator categoryitemlabelgenerator = getItemLabelGenerator(i, j);
    if (categoryitemlabelgenerator != null && isItemLabelVisible(i, j))
        drawItemLabel(graphics2d, ganttcategorydataset, i, j, categoryplot, categoryitemlabelgenerator, double1,
                false);
    if (categoryitemrendererstate.getInfo() != null) {
        EntityCollection entitycollection = categoryitemrendererstate.getEntityCollection();
        if (entitycollection != null) {
            String s = null;
            CategoryToolTipGenerator categorytooltipgenerator = getToolTipGenerator(i, j);
            if (categorytooltipgenerator != null)
                s = categorytooltipgenerator.generateToolTip(ganttcategorydataset, i, j);
            String s1 = null;
            if (getItemURLGenerator(i, j) != null)
                s1 = getItemURLGenerator(i, j).generateURL(ganttcategorydataset, i, j);
            CategoryItemEntity categoryitementity = new CategoryItemEntity(double1, s, s1, ganttcategorydataset,
                    ganttcategorydataset.getRowKey(i), ganttcategorydataset.getColumnKey(j));
            entitycollection.add(categoryitementity);
        }
    }
}

From source file:org.openfaces.component.chart.impl.renderers.XYLineFillRenderer.java

private double calculateItemYPoint(int series, int item, Rectangle2D dataArea, ValueAxis rangeAxis,
        XYDataset dataSet, XYPlot plot) {
    double yValue = dataSet.getYValue(series, item);
    return rangeAxis.valueToJava2D(yValue, dataArea, plot.getRangeAxisEdge());
}

From source file:de.laures.cewolf.jfree.XYSplineRenderer.java

/**
 * Draws the item (first pass). This method draws the lines
 * connecting the items. Instead of drawing separate lines,
 * a GeneralPath is constructed and drawn at the end of the series painting.
 *
 * @param g2  the graphics device./*from  www.  j a  v  a2 s  .  com*/
 * @param state  the renderer state.
 * @param plot  the plot (can be used to obtain standard color information etc).
 * @param dataset  the dataset.
 * @param pass  the pass.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataArea  the area within which the data is being drawn.
 */
protected void drawPrimaryLineAsPath(XYItemRendererState state, Graphics2D g2, XYPlot plot, XYDataset dataset,
        int pass, int series, int item, ValueAxis domainAxis, ValueAxis rangeAxis, Rectangle2D dataArea) {

    RectangleEdge xAxisLocation = plot.getDomainAxisEdge();
    RectangleEdge yAxisLocation = plot.getRangeAxisEdge();

    // get the data points
    double x1 = dataset.getXValue(series, item);
    double y1 = dataset.getYValue(series, item);
    double transX1 = domainAxis.valueToJava2D(x1, dataArea, xAxisLocation);
    double transY1 = rangeAxis.valueToJava2D(y1, dataArea, yAxisLocation);

    // collect points
    if (!Double.isNaN(transX1) && !Double.isNaN(transY1)) {
        ControlPoint p = new ControlPoint(
                plot.getOrientation() == PlotOrientation.HORIZONTAL ? (float) transY1 : (float) transX1,
                plot.getOrientation() == PlotOrientation.HORIZONTAL ? (float) transX1 : (float) transY1);
        if (!this.points.contains(p)) {
            this.points.add(p);
        }
    }
    if (item == dataset.getItemCount(series) - 1) {
        State s = (State) state;
        // construct path
        if (this.points.size() > 1) {
            // we need at least two points to draw something
            ControlPoint cp0 = (ControlPoint) this.points.get(0);
            s.seriesPath.moveTo(cp0.x, cp0.y);
            if (this.points.size() == 2) {
                // we need at least 3 points to spline. Draw simple line for two points
                ControlPoint cp1 = (ControlPoint) this.points.get(1);
                s.seriesPath.lineTo(cp1.x, cp1.y);
            } else {
                // construct spline
                int np = this.points.size(); // number of points
                float[] d = new float[np]; // Newton form coefficients
                float[] x = new float[np]; // x-coordinates of nodes
                float y;
                float t;
                float[] a = new float[np];
                float t1;
                float t2;
                float[] h = new float[np];

                for (int i = 0; i < np; i++) {
                    ControlPoint cpi = (ControlPoint) this.points.get(i);
                    x[i] = cpi.x;
                    d[i] = cpi.y;
                }

                for (int i = 1; i <= np - 1; i++) {
                    h[i] = x[i] - x[i - 1];
                }
                float[] sub = new float[np - 1];
                float[] diag = new float[np - 1];
                float[] sup = new float[np - 1];

                for (int i = 1; i <= np - 2; i++) {
                    diag[i] = (h[i] + h[i + 1]) / 3;
                    sup[i] = h[i + 1] / 6;
                    sub[i] = h[i] / 6;
                    a[i] = (d[i + 1] - d[i]) / h[i + 1] - (d[i] - d[i - 1]) / h[i];
                }
                solveTridiag(sub, diag, sup, a, np - 2);

                // note that a[0]=a[np-1]=0
                // draw
                s.seriesPath.moveTo(x[0], d[0]);
                for (int i = 1; i <= np - 1; i++) {
                    // loop over intervals between nodes
                    for (int j = 1; j <= this.precision; j++) {
                        t1 = (h[i] * j) / this.precision;
                        t2 = h[i] - t1;
                        y = ((-a[i - 1] / 6 * (t2 + h[i]) * t1 + d[i - 1]) * t2
                                + (-a[i] / 6 * (t1 + h[i]) * t2 + d[i]) * t1) / h[i];
                        t = x[i - 1] + t1;
                        s.seriesPath.lineTo(t, y);
                    }
                }
            }
            // draw path
            drawFirstPassShape(g2, pass, series, item, s.seriesPath);
        }

        // reset points vector
        this.points = new Vector();
    }
}