class_docstr: Rada graph class
class_docstr_tok: ["Rada","graph","class"]
docstr: Override x axis to make it polar
docstr_tok: ["Override","x","axis","to","make","it","polar"]
code: def _x_axis(self, draw_axes=True):
      """Override x axis to make it polar"""
      if not self._x_labels or not self.show_x_labels:
          return
  
      axis = self.svg.node(
          self.nodes["plot"],
          class_="axis x web%s"
          % (" always_show" if self.show_x_guides else ""),
      )
      format_ = lambda x: "%f %f" % x
      center = self.view((0, 0))
      r = self._rmax
  
      # Can't simply determine truncation
      truncation = self.truncate_label or 25
  
      for label, theta in self._x_labels:
          major = label in self._x_labels_major
          if not (self.show_minor_x_labels or major):
              continue
          guides = self.svg.node(axis, class_="guides")
          end = self.view((r, theta))
  
          self.svg.node(
              guides,
              "path",
              d="M%s L%s" % (format_(center), format_(end)),
              class_="%s%sline"
              % (
                  "axis " if label == "0" else "",
                  "major " if major else "",
              ),
          )
  
          r_txt = (1 - self._box.__class__.margin) * self._box.ymax
          pos_text = self.view((r_txt, theta))
          text = self.svg.node(
              guides,
              "text",
              x=pos_text[0],
              y=pos_text[1],
              class_="major" if major else "",
          )
          text.text = truncate(label, truncation)
          if text.text != label:
              self.svg.node(guides, "title").text = label
          else:
              self.svg.node(
                  guides,
                  "title",
              ).text = self._x_format(theta)
  
          angle = -theta + pi / 2
          if cos(angle) < 0:
              angle -= pi
          text.attrib["transform"] = "rotate(%f %s)" % (
              self.x_label_rotation or deg(angle),
              format_(pos_text),
          )
  
file_path: pygal/pygal/graph/radar.py
imports: from math import cos, pi
  from pygal.adapters import none_to_zero, positive
  from pygal.graph.line import Line
  from pygal.util import cached_property, compute_scale, cut, deg, truncate
  from pygal.view import PolarLogView, PolarView
label_desc: Use image node_id 5 for calling the Radar obj's underlying member method code with example usage: obj._x_axis(draw_axes) without return types