class_docstr: Draws a draggable target symbol (circle plus crosshair).
  
  The size of TargetItem will remain fixed on screen even as the view is zoomed.
  Includes an optional text label.
class_docstr_tok: ["Draws","a","draggable","target","symbol","(","circle","plus","crosshair",")",".","The","size","of","TargetItem","will","remain","fixed","on","screen","even","as","the","view","is","zoomed",".","Includes","an","optional","text","label","."]
docstr: Method to call to enable or disable the TargetLabel for displaying text
  
  Parameters
  ----------
  text : Callable or str, optional
      Details how to format the text, by default None
      If None, do not show any text next to the TargetItem
      If Callable, then the label will display the result of ``text(x, y)``
      If a fromatted string, then the output of ``text.format(x, y)`` will be
      displayed
      If a non-formatted string, then the text label will display ``text``, by
      default None
  labelOpts : dict, optional
      These arguments are passed on to :class:`~pyqtgraph.TextItem`
docstr_tok: ["Method","to","call","to","enable","or","disable","the","TargetLabel","for","displaying","text","Parameters","--","--","--","--","--","text",":","Callable","or","str",",","optional","Details","how","to","format","the","text",",","by","default","None","If","None",",","do","not","show","any","text","next","to","the","TargetItem","If","Callable",",","then","the","label","will","display","the","result","of","``","text","(","x",",","y",")","``","If","a","fromatted","string",",","then","the","output","of","``","text.format","(","x",",","y",")","``","will","be","displayed","If","a","non-formatted","string",",","then","the","text","label","will","display","``","text","``",",","by","default","None","labelOpts",":","dict",",","optional","These","arguments","are","passed","on","to",":","class",":","`","~pyqtgraph.TextItem","`"]
code: def setLabel(self, text=None, labelOpts=None):
      """Method to call to enable or disable the TargetLabel for displaying text
  
      Parameters
      ----------
      text : Callable or str, optional
          Details how to format the text, by default None
          If None, do not show any text next to the TargetItem
          If Callable, then the label will display the result of ``text(x, y)``
          If a fromatted string, then the output of ``text.format(x, y)`` will be
          displayed
          If a non-formatted string, then the text label will display ``text``, by
          default None
      labelOpts : dict, optional
          These arguments are passed on to :class:`~pyqtgraph.TextItem`
      """
      if not text:
          if (
              self._label is not None
              and self._label.scene() is not None
          ):
              # remove the label if it's already added
              self._label.scene().removeItem(self._label)
          self._label = None
      else:
          # provide default text if text is True
          if text is True:
              # convert to default value or empty string
              text = "x = {: .3n}\ny = {: .3n}"
  
          labelOpts = {} if labelOpts is None else labelOpts
          if self._label is not None:
              self._label.scene().removeItem(self._label)
          self._label = TargetLabel(self, text=text, **labelOpts)
  
imports: import string
  from math import atan2
  from ..None import functions
  from ..Point import Point
  from ..Qt import QtCore, QtGui
  from .GraphicsObject import GraphicsObject
  from .ScatterPlotItem import Symbols
  from .TextItem import TextItem
  from .UIGraphicsItem import UIGraphicsItem
  from .ViewBox import ViewBox
label_desc: Use image node_id 19 for calling the TargetItem obj's underlying member method code with example usage: obj.setLabel(text, labelOpts) without return types