def InlineLegend(chart):
 show = False
 labels = []
 label_positions = []
 for series in chart.data:
  if (series.label is None):
   labels.append('')
  else:
   labels.append(series.label)
   show = True
  label_positions.append(series.data[(-1)])
 if show:
  chart.right.min = chart.left.min
  chart.right.max = chart.left.max
  chart.right.labels = labels
  chart.right.label_positions = label_positions
  chart._show_legend = False

def InlineLegend ( chart ) : show = False labels = [ ] label_positions = [ ] for series in chart . data : if ( series . label is None ) : labels . append ( '' ) else : labels . append ( series . label ) show = True label_positions . append ( series . data [ ( - 1 ) ] ) if show : chart . right . min = chart . left . min chart . right . max = chart . left . max chart . right . labels = labels chart . right . label_positions = label_positions chart . _show_legend = False
provide a legend for line charts by attaching labels to the right end of each line .