def getEdgeOppositeHorizontally(self, pp, symbol, x, onY2):
        xMin = pp.getXMin()
        xMax = pp.getXMax()
        xMid = symbol.getBaseline()
        if (Double.NaN==(xMid)):
            xMid = (xMin + xMax)/2.

        xMinPx = pp.xToPixel(xMin)
        xMaxPx = pp.xToPixel(xMax)
        xMidPx = pp.xToPixel(xMid)
        xPx = pp.xToPixel(x)
        prevXPx = Double.NaN
        nextXPx = Double.NaN
        width = symbol.getWidth(pp)

        symWidth = self.getAdjustedWidth(width, xPx,
                                    prevXPx, nextXPx,
                                    xMinPx, xMaxPx, xMidPx)
        if (Double.NaN==(symWidth)):
            return Double.NaN


        xLeft = self.getUpperLeftX(width, xPx,
                                    prevXPx, nextXPx,
                                    xMinPx, xMaxPx, xMidPx,
                                    pp.getXMousePlotArea())
        if (Double.NaN==(xLeft)):
            return Double.NaN


        result = xLeft + symWidth
        if abs(xLeft - xPx) > abs(result - xPx):
            result = xLeft

        return result



    # gets edge that is furthest away from the point, vertically
    # Note: for bar charts, this is the edge of the symbol
    # along the x-axis, x2-axis, or horizontal baseline.
dataset/ETHPy150Open anandology/pyjamas/library/gwt/chart/SymbolType.py/SymbolType.getEdgeOppositeHorizontally/original