private void smooth(ObservableList<PathElement> strokeElements, ObservableList<PathElement> fillElements, final double HEIGHT) {
        if (fillElements.isEmpty()) return;
        // as we do not have direct access to the data, first recreate the list of all the data points we have
        final Point[] dataPoints = new Point[strokeElements.size()];
        for (int i = 0; i < strokeElements.size(); i++) {
            final PathElement element = strokeElements.get(i);
            if (element instanceof MoveTo) {
                final MoveTo move = (MoveTo) element;
                dataPoints[i] = new Point(move.getX(), move.getY());
            } else if (element instanceof LineTo) {
                final LineTo line = (LineTo) element;
                final double x = line.getX(), y = line.getY();
                dataPoints[i] = new Point(x, y);
            }
        }
        double firstX = dataPoints[0].getX();
        double lastX  = dataPoints[dataPoints.length - 1].getX();

        Point[] points = Helper.subdividePoints(dataPoints, getSubDivisions());

        fillElements.clear();
        fillElements.add(new MoveTo(firstX, HEIGHT));

        strokeElements.clear();
        strokeElements.add(new MoveTo(points[0].getX(), points[0].getY()));

        for (Point p : points) {
            if (Double.compare(p.getX(), firstX) >= 0) {
                fillElements.add(new LineTo(p.getX(), p.getY()));
                strokeElements.add(new LineTo(p.getX(), p.getY()));
            }
        }

        fillElements.add(new LineTo(lastX, HEIGHT));
        fillElements.add(new LineTo(0, HEIGHT));
        fillElements.add(new ClosePath());
    }
Returns an array of paths where the first entry represents the fill path
and the second entry represents the stroke path
@param SERIES
@return an array of paths where [0] == FillPath and [1] == StrokePath
src/main/java/eu/hansolo/tilesfx/chart/SmoothedChart.java