class_docstr: GraphicsWidget displaying text.
  Used mainly as axis labels, titles, etc.
  
  Note: To display text inside a scaled view (ViewBox, PlotWidget, etc) use TextItem
docstr: Set the text and text properties in the label. Accepts optional arguments for auto-generating
  a CSS style string:
  
  ==================== ==============================
  **Style Arguments:**
  color                (str) example: '#CCFF00'
  size                 (str) example: '8pt'
  bold                 (bool)
  italic               (bool)
  ==================== ==============================
docstr_tok: ["Set","the","text","and","text","properties","in","the","label",".","Accepts","optional","arguments","for","auto-generating","a","CSS","style","string",":","====================","==============================","*","*","Style","Arguments",":","*","*","color","(","str",")","example",":","'","#","CCFF00'","size","(","str",")","example",":","'8pt'","bold","(","bool",")","italic","(","bool",")","====================","=============================="]
code: def setText(self, text, **args):
      """Set the text and text properties in the label. Accepts optional arguments for auto-generating
      a CSS style string:
  
      ==================== ==============================
      **Style Arguments:**
      color                (str) example: '#CCFF00'
      size                 (str) example: '8pt'
      bold                 (bool)
      italic               (bool)
      ==================== ==============================
      """
      self.text = text
      opts = self.opts
      for k in args:
          opts[k] = args[k]
  
      optlist = []
  
      color = self.opts["color"]
      if color is None:
          color = getConfigOption("foreground")
      color = fn.mkColor(color)
      optlist.append(
          "color: " + color.name(QtGui.QColor.NameFormat.HexArgb)
      )
      if "size" in opts:
          optlist.append("font-size: " + opts["size"])
      if "bold" in opts and opts["bold"] in [True, False]:
          optlist.append(
              "font-weight: "
              + {True: "bold", False: "normal"}[opts["bold"]]
          )
      if "italic" in opts and opts["italic"] in [True, False]:
          optlist.append(
              "font-style: "
              + {True: "italic", False: "normal"}[opts["italic"]]
          )
      full = "<span style='%s'>%s</span>" % ("; ".join(optlist), text)
      # print full
      self.item.setHtml(full)
      self.updateMin()
      self.resizeEvent(None)
      self.updateGeometry()
  
file_path: pyqtgraph/pyqtgraph/graphicsItems/LabelItem.py
imports: from ..None import functions
  from ..None import getConfigOption
  from ..Qt import QtCore, QtWidgets, QtGui
  from .GraphicsWidget import GraphicsWidget
  from .GraphicsWidgetAnchor import GraphicsWidgetAnchor
label_desc: Use image node_id 3 for calling the LabelItem obj's underlying member method code with example usage: obj.setText(text) without return types