code: def legend(self, values):
          
          if not isinstance(values, list):
              raise TypeError("legend must be a list of labels")
  
          self.options["legend"] = values
docs: Set the legend labels.
  
              Args:
                  values (list): list of labels.
  
              Raises:
                  ValueError: legend must be a list of labels.