def x_upper_limit(self, limit=None):
if limit is None:<EOL><INDENT>if self._x_upper_limit is None:<EOL><INDENT>if self.smallest_x() == self.largest_x():<EOL><INDENT>if int(self.largest_x()) == float(self.largest_x()):<EOL><INDENT>return self.largest_x() + <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>return math.ceil(self.largest_x())<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return self.largest_x()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return self._x_upper_limit<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if not is_numeric(limit):<EOL><INDENT>raise TypeError(<EOL>"<STR_LIT>" % str(limit)<EOL>)<EOL><DEDENT>if limit <= self.smallest_x():<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>" % (<EOL>str(self.smallest_x()), str(limit)<EOL>)<EOL>)<EOL><DEDENT>self._x_upper_limit = limit<EOL><DEDENT>
Returns or sets (if a value is provided) the value at which the
        x-axis should end. By default this is the highest x value in the
        associated series.

        :param limit: If given, the chart's x_upper_limit will be set to this.
        :raises ValueError: if you try to make the upper limit smaller than the\
        lower limit.