class_docstr: Configure annotations (for pie and bar charts).
  
  Examples
  --------
  .. jupyter-execute::
      :linenos:
      :emphasize-lines: 6
  
      from lets_plot import *
      LetsPlot.setup_html()
      data = {'name': ['a', 'b', 'c', 'd', 'b'], 'value': [40, 90, 10, 50, 20 ] }
      ggplot(data) + geom_pie(aes(slice='value', fill='name'), size=15, hole=0.4, \
                              stat='identity', tooltips = 'none', \
                              labels=layer_labels().line('@value'))
docstr: Define the format for displaying the value.
  This format will be applied to the corresponding value specified in the 'line' template.
  
  Parameters
  ----------
  field : str
      Name of an aesthetic or variable that would be formatted.
      The field name starts with a '^' prefix for aesthetics,
      the variable name starts with a '@' prefix or without any prefix.
  format : str
      Formatting specification. The format contains a number format ('1.f'),
      a string template ('{.1f}') or a date/time format ('%d.%m.%y').
      The numeric format for non-numeric value will be ignored.
      If you need to include a brace character in the literal text,
      it can be escaped by doubling: `{{` and `}}`.
  
  Returns
  -------
  `layer_labels`
      Annotations specification.
  
  Notes
  -----
  For more info see https://lets-plot.org/pages/formats.html.
  
  Examples
  --------
  .. jupyter-execute::
      :linenos:
      :emphasize-lines: 8
  
      from lets_plot import *
      from lets_plot.mapping import *
      LetsPlot.setup_html()
      data = {'name': ['a', 'b', 'c', 'd', 'b'], 'value': [40, 90, 10, 50, 20 ] }
      ggplot(data) + geom_pie(aes(fill=as_discrete('name', order_by='..count..'), weight='value'), \
                              size=15, tooltips='none', \
                              labels=layer_labels(['..proppct..']) \
                                            .format('..proppct..', '{.1f}%'))
  
  |
  
  .. jupyter-execute::
      :linenos:
      :emphasize-lines: 8, 10, 12, 14
  
      from lets_plot import *
      from lets_plot.mapping import *
      LetsPlot.setup_html()
      data = {'name': ['a', 'b', 'c', 'd', 'b'], 'value': [40, 90, 10, 50, 20 ] }
      ggplot(data) + geom_pie(aes(fill=as_discrete('name', order_by='..count..', order=1), weight='value'), \
                              size=15, tooltips='none', \
                              labels=layer_labels() \
                                              .format('^fill', '{{{}}}') \
                                              .line('^fill') \
                                              .format('..count..', 'd') \
                                              .line('@{..count..}') \
                                              .format('..prop..', '.1%') \
                                              .line('@{..prop..}') \
                                              .format('..sum..', 'of {d}') \
                                              .line('@{..sum..}'))
code: def format(self, field=None, format=None):
      """
          Define the format for displaying the value.
          This format will be applied to the corresponding value specified in the 'line' template.
  
          Parameters
          ----------
          field : str
              Name of an aesthetic or variable that would be formatted.
              The field name starts with a '^' prefix for aesthetics,
              the variable name starts with a '@' prefix or without any prefix.
          format : str
              Formatting specification. The format contains a number format ('1.f'),
              a string template ('{.1f}') or a date/time format ('%d.%m.%y').
              The numeric format for non-numeric value will be ignored.
              If you need to include a brace character in the literal text,
              it can be escaped by doubling: `{{` and `}}`.
  
          Returns
          -------
          `layer_labels`
              Annotations specification.
  
          Notes
          -----
          For more info see https://lets-plot.org/pages/formats.html.
  
          Examples
          --------
          .. jupyter-execute::
              :linenos:
              :emphasize-lines: 8
  
              from lets_plot import *
              from lets_plot.mapping import *
              LetsPlot.setup_html()
              data = {'name': ['a', 'b', 'c', 'd', 'b'], 'value': [40, 90, 10, 50, 20 ] }
              ggplot(data) + geom_pie(aes(fill=as_discrete('name', order_by='..count..'), weight='value'), \\
                                      size=15, tooltips='none', \\
                                      labels=layer_labels(['..proppct..']) \\
                                                    .format('..proppct..', '{.1f}%'))
  
          |
  
          .. jupyter-execute::
              :linenos:
              :emphasize-lines: 8, 10, 12, 14
  
              from lets_plot import *
              from lets_plot.mapping import *
              LetsPlot.setup_html()
              data = {'name': ['a', 'b', 'c', 'd', 'b'], 'value': [40, 90, 10, 50, 20 ] }
              ggplot(data) + geom_pie(aes(fill=as_discrete('name', order_by='..count..', order=1), weight='value'), \\
                                      size=15, tooltips='none', \\
                                      labels=layer_labels() \\
                                                      .format('^fill', '{{{}}}') \\
                                                      .line('^fill') \\
                                                      .format('..count..', 'd') \\
                                                      .line('@{..count..}') \\
                                                      .format('..prop..', '.1%') \\
                                                      .line('@{..prop..}') \\
                                                      .format('..sum..', 'of {d}') \\
                                                      .line('@{..sum..}'))
  
          """
      self._formats.append({"field": field, "format": format})
      return self
  
file_path: lets-plot/python-package/lets_plot/plot/annotation.py
imports: from typing import List
  from lets_plot.plot.core import FeatureSpec, _filter_none
label_desc: Use image node_id 3 for calling the layer_labels obj's underlying member method code with example usage: obj.format(field, format) and returns: self