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

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
automatically fill out the legend based on series labels .