'Creates a polygon from a list of x and y coordinates.
:returns: A polygon with point corresponding to ``xData`` and ``yData``.
:rtype: QPolygonF'

@staticmethod
def polygon_from_data(xData, yData):

    if (xData and yData):
        n = min(len(xData), len(yData))
        p = QPolygonF((n + 1))
        for i in range(n):
            p[i] = QPointF(xData[i], yData[i])
        p[n] = QPointF(xData[0], yData[0])
        return p
    else:
        return QPolygonF()
