class_docstr: Funnel graph class
class_docstr_tok: ["Funnel","graph","class"]
docstr: Compute y min and max and y scale and set labels
docstr_tok: ["Compute","y","min","and","max","and","y","scale","and","set","labels"]
code: def _compute(self):
      """Compute y min and max and y scale and set labels"""
      self._x_pos = (
          [(x + 1) / self._order for x in range(self._order)]
          if self._order != 1
          else [0.5]
      )  # Center if only one value
  
      previous = [[self.zero, self.zero] for i in range(self._len)]
      for i, serie in enumerate(self.series):
          y_height = -sum(serie.safe_values) / 2
          all_x_pos = [0] + self._x_pos
          serie.points = []
          for j, value in enumerate(serie.values):
              poly = []
              poly.append((all_x_pos[i], previous[j][0]))
              poly.append((all_x_pos[i], previous[j][1]))
              previous[j][0] = y_height
              y_height = previous[j][1] = y_height + value
              poly.append((all_x_pos[i + 1], previous[j][1]))
              poly.append((all_x_pos[i + 1], previous[j][0]))
              serie.points.append(poly)
  
      val_max = max(
          list(map(sum, cut(self.series, "values"))) + [self.zero]
      )
      self._box.ymin = -val_max
      self._box.ymax = val_max
  
      if self.range and self.range[0] is not None:
          self._box.ymin = self.range[0]
  
      if self.range and self.range[1] is not None:
          self._box.ymax = self.range[1]
  
file_path: pygal/pygal/graph/funnel.py
imports: from pygal.adapters import none_to_zero, positive
  from pygal.graph.graph import Graph
  from pygal.util import alter, cut, decorate
label_desc: Use image node_id 4 for calling the Funnel obj's underlying member method code with example usage: obj._compute() without return types