code: func (p *Panel) RepeatTargetsForDatasources(dsNames ...string) {
  	repeatTarget := func(dsNames []string, targets *[]Target) {
  		var lastRefID string
  		lenTargets := len(*targets)
  		for i, name := range dsNames {
  			if i < lenTargets {
  				(*targets)[i].Datasource = name
  				lastRefID = (*targets)[i].RefID
  			} else {
  				newTarget := (*targets)[i%lenTargets]
  				lastRefID = incRefID(lastRefID)
  				newTarget.RefID = lastRefID
  				newTarget.Datasource = name
  				*targets = append(*targets, newTarget)
  			}
  		}
  	}
  	switch p.OfType {
  	case GraphType:
  		repeatTarget(dsNames, &p.GraphPanel.Targets)
  	case SinglestatType:
  		repeatTarget(dsNames, &p.SinglestatPanel.Targets)
  	case TableType:
  		repeatTarget(dsNames, &p.TablePanel.Targets)
  	}
  }
docs: // RepeatTargetsForDatasources repeats all existing targets for a panel
  // for all provided in the argument datasources. Existing datasources of
  // targets are ignored.