def AutoLegend(chart):
  """Automatically fill out the legend based on series labels.  This will only
  fill out the legend if is at least one series with a label.
  """
  chart._show_legend = False
  labels = []
  for series in chart.data:
    if series.label is None:
      labels.append('')
    else:
      labels.append(series.label)
      chart._show_legend = True
  if chart._show_legend:
    chart._legend_labels = labels
Automatically fill out the legend based on series labels.  This will only
  fill out the legend if is at least one series with a label.
  
mapreduce/lib/graphy/formatters.py