class_docstr: Chart public functions
class_docstr_tok: ["Chart","public","functions"]
docstr: Make a mini text sparkline from chart
docstr_tok: ["Make","a","mini","text","sparkline","from","chart"]
code: def render_sparktext(self, relative_to=None):
      """Make a mini text sparkline from chart"""
      bars = "▁▂▃▄▅▆▇█"
      if len(self.raw_series) == 0:
          return ""
      values = list(self.raw_series[0][0])
      if len(values) == 0:
          return ""
  
      chart = ""
      values = list(map(lambda x: max(x, 0), values))
  
      vmax = max(values)
      if relative_to is None:
          relative_to = min(values)
  
      if (vmax - relative_to) == 0:
          chart = bars[0] * len(values)
          return chart
  
      divisions = len(bars) - 1
      for value in values:
          chart += bars[
              int(
                  divisions
                  * (value - relative_to)
                  / (vmax - relative_to)
              )
          ]
      return chart
  
imports: import base64
  import io
  from pygal._compat import is_list_like
  from pygal.graph.base import BaseGraph
label_desc: Use image node_id 14 for calling the PublicApi obj's underlying member method code with example usage: obj.render_sparktext(relative_to) and returns: chart, str, str, chart