def __call__(self, chart):
    """Format the chart by setting the min/max values on its dependent axis."""
    if not chart.data:
      return # Nothing to do.
    min_value, max_value = chart.GetMinMaxValues()
    if None in (min_value, max_value):
      return  # No data.  Nothing to do.

    # Honor user's choice, if they've picked min/max.
    for axis in chart.GetDependentAxes():
      if axis.min is not None:
        min_value = axis.min
      if axis.max is not None:
        max_value = axis.max

    buffer = (max_value - min_value) * self.buffer  # Stay away from edge.

    for axis in chart.GetDependentAxes():
      if axis.min is None:
        axis.min = min_value - buffer
      if axis.max is None:
        axis.max = max_value + buffer
Format the chart by setting the min/max values on its dependent axis.
mapreduce/lib/graphy/formatters.py