parameters: (chart)
docstring: 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.
docstring_summary: 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.
docstring_tokens: 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 .
function: 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
function_tokens: def AutoLegend ( chart ) : 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