class_docstr: Plot functions for mixed type x & y axes:
  
  Methods:
      - bar
      - bar_stacked
      - lollipop
      - parallel
class_docstr_tok: ["Plot","functions","for","mixed","type","x","&","y","axes",":","Methods",":","-","bar","-","bar_stacked","-","lollipop","-","parallel"]
docstr: Text plot for use with stacked plots.
  
  Args:
      data_frame (pandas.DataFrame): Data source for the plot.
      categorical_columns (str or list): Column name to plot on
          the categorical axis.
      numeric_column (str): Column name to plot on the numerical axis.
      text_column (str): Column name to plot as text labels.
          Note: Null text values will be omitted from the plot.
      stack_column (str): Column name to group by on the stack dimension.
      normalize (bool, optional): Normalize numeric dimension for
          100% stacked bars. Default False.
      stack_order (list, optional): List of values within the
          'stack_column' dimension for specific stack sort.
      categorical_order_by (str or array-like, optional):
          Dimension for ordering the categorical axis. Default 'values'.
          - 'values': Order categorical axis by the numerical
              axis values. Default.
          - 'labels': Order categorical axis by the categorical labels.
          - array-like object (list, tuple, np.array): New labels
              to conform the categorical axis to.
      categorical_order_ascending (bool, optional): Sort order of the
          categorical axis. Default False.
      font_size (str, optional): Size of text.
      x_offset (int, optional): # of pixels for horizontal text offset.
          Can be negative. Default: 0.
      y_offset (int, optional): # of pixels for vertical text offset.
          Can be negative. Default: 0.
      angle (int): Degrees from horizontal for text rotation.
      text_color (str): Color name or hex value.
          See chartify.color_palettes.show() for available color names.
          If omitted, will default to the next color in
          the current color palette.
docstr_tok: ["Text","plot","for","use","with","stacked","plots",".","Args",":","data_frame","(","pandas.DataFrame",")",":","Data","source","for","the","plot",".","categorical_columns","(","str","or","list",")",":","Column","name","to","plot","on","the","categorical","axis",".","numeric_column","(","str",")",":","Column","name","to","plot","on","the","numerical","axis",".","text_column","(","str",")",":","Column","name","to","plot","as","text","labels",".","Note",":","Null","text","values","will","be","omitted","from","the","plot",".","stack_column","(","str",")",":","Column","name","to","group","by","on","the","stack","dimension",".","normalize","(","bool",",","optional",")",":","Normalize","numeric","dimension","for","100","%","stacked","bars",".","Default","False",".","stack_order","(","list",",","optional",")",":","List","of","values","within","the","'stack_column","'","dimension","for","specific","stack","sort",".","categorical_order_by","(","str","or","array-like",",","optional",")",":","Dimension","for","ordering","the","categorical","axis",".","Default","'values","'",".","-","'values","'",":","Order","categorical","axis","by","the","numerical","axis","values",".","Default",".","-","'labels","'",":","Order","categorical","axis","by","the","categorical","labels",".","-","array-like","object","(","list",",","tuple",",","np.array",")",":","New","labels","to","conform","the","categorical","axis","to",".","categorical_order_ascending","(","bool",",","optional",")",":","Sort","order","of","the","categorical","axis",".","Default","False",".","font_size","(","str",",","optional",")",":","Size","of","text",".","x_offset","(","int",",","optional",")",":","#","of","pixels","for","horizontal","text","offset",".","Can","be","negative",".","Default",":","0.","y_offset","(","int",",","optional",")",":","#","of","pixels","for","vertical","text","offset",".","Can","be","negative",".","Default",":","0.","angle","(","int",")",":","Degrees","from","horizontal","for","text","rotation",".","text_color","(","str",")",":","Color","name","or","hex","value",".","See","chartify.color_palettes.show","(",")","for","available","color","names",".","If","omitted",",","will","default","to","the","next","color","in","the","current","color","palette","."]
code: def text_stacked(
      self,
      data_frame,
      categorical_columns,
      numeric_column,
      stack_column,
      text_column,
      normalize=False,
      stack_order=None,
      categorical_order_by="values",
      categorical_order_ascending=False,
      font_size="1em",
      x_offset=0,
      y_offset=0,
      angle=0,
      text_color=None,
  ):
      """Text plot for use with stacked plots.
  
      Args:
          data_frame (pandas.DataFrame): Data source for the plot.
          categorical_columns (str or list): Column name to plot on
              the categorical axis.
          numeric_column (str): Column name to plot on the numerical axis.
          text_column (str): Column name to plot as text labels.
              Note: Null text values will be omitted from the plot.
          stack_column (str): Column name to group by on the stack dimension.
          normalize (bool, optional): Normalize numeric dimension for
              100% stacked bars. Default False.
          stack_order (list, optional): List of values within the
              'stack_column' dimension for specific stack sort.
          categorical_order_by (str or array-like, optional):
              Dimension for ordering the categorical axis. Default 'values'.
              - 'values': Order categorical axis by the numerical
                  axis values. Default.
              - 'labels': Order categorical axis by the categorical labels.
              - array-like object (list, tuple, np.array): New labels
                  to conform the categorical axis to.
          categorical_order_ascending (bool, optional): Sort order of the
              categorical axis. Default False.
          font_size (str, optional): Size of text.
          x_offset (int, optional): # of pixels for horizontal text offset.
              Can be negative. Default: 0.
          y_offset (int, optional): # of pixels for vertical text offset.
              Can be negative. Default: 0.
          angle (int): Degrees from horizontal for text rotation.
          text_color (str): Color name or hex value.
              See chartify.color_palettes.show() for available color names.
              If omitted, will default to the next color in
              the current color palette.
      """
      vertical = self._chart.axes._vertical
      text_font = self._chart.style._get_settings(
          "text_callout_and_plot"
      )["font"]
  
      source, factors, stack_values = self._construct_source(
          data_frame,
          categorical_columns,
          numeric_column,
          stack_column,
          normalize=normalize,
          categorical_order_by=categorical_order_by,
          categorical_order_ascending=categorical_order_ascending,
      )
  
      if text_color:
          text_color = Color(text_color).get_hex_l()
          if stack_order is None:
              stack_order = sorted(data_frame[stack_column].unique())
          else:
              # If stack order is set then
              # make sure it includes all the levels.
              if not set(data_frame[stack_column].unique()).issubset(
                  set(stack_order)
              ):
                  raise ValueError(
                      """Color order must include
                                      all unique factors of variable `%s`."""
                      % stack_order
                  )
          colors, color_values = [text_color] * len(
              data_frame[stack_column].unique()
          ), stack_order
      else:
          colors, color_values = self._get_color_and_order(
              data_frame, stack_column, stack_order
          )
  
      self._set_categorical_axis_default_factors(vertical, factors)
      self._set_categorical_axis_default_range(
          vertical, data_frame, numeric_column
      )
  
      # Set numeric axis format to percentages.
      if normalize:
          if vertical:
              self._chart.axes.set_yaxis_tick_format("0%")
          else:
              self._chart.axes.set_xaxis_tick_format("0%")
  
      text_baseline = "middle"
      if vertical:
          text_align = "center"
      else:
          text_align = "left"
          x_offset = x_offset + 10
  
      cumulative_numeric_value = None
  
      for color_value, color in zip(color_values, colors):
          sliced_data = data_frame[
              (data_frame[stack_column] == color_value)
          ]
          # Reindex to be consistent with the factors.
          type_map = {column: str for column in categorical_columns}
          sliced_data = (
              sliced_data.astype(type_map)
              .set_index(categorical_columns)
              .reindex(index=factors)
              .reset_index()
          )
  
          text_values = np.where(
              sliced_data[text_column].isna(),
              "",
              sliced_data[text_column].astype(str),
          )
  
          if cumulative_numeric_value is not None:
              cumulative_numeric_value = (
                  cumulative_numeric_value
                  + source.data[color_value] * 0.5
              )
          else:
              cumulative_numeric_value = source.data[color_value] * 0.5
  
          if vertical:
              x_value, y_value = factors, cumulative_numeric_value
          else:
              y_value, x_value = factors, cumulative_numeric_value
  
          self._chart.figure.text(
              text=text_values,
              x=x_value,
              y=y_value,
              text_font_size=font_size,
              text_color=color,
              y_offset=y_offset,
              x_offset=x_offset,
              angle=angle,
              angle_units="deg",
              text_align=text_align,
              text_baseline=text_baseline,
              text_font=text_font,
          )
  
          cumulative_numeric_value = (
              cumulative_numeric_value + source.data[color_value] * 0.5
          )
  
      return self._chart
  
imports: import bokeh
  import pandas
  import numpy
  from chartify._core.colors import Color, color_palettes
  from chartify._core.axes import NumericalYMixin, NumericalXMixin
  from scipy.stats import gaussian_kde
label_desc: Use image node_id 9 for calling the PlotMixedTypeXY obj's underlying member method code with example usage: obj.text_stacked(data_frame, categorical_columns, numeric_column, stack_column, text_column, normalize, stack_order, categorical_order_by, categorical_order_ascending, font_size, x_offset, y_offset, angle, text_color) and returns: self