code: def _write_categories(self, workbook, worksheet):
          
          categories = self._chart_data.categories
          num_format = workbook.add_format({
              'num_format': categories.number_format,
          })
          depth = categories.depth
          for idx, level in enumerate(categories.levels):
              col = depth - idx - 1
              self._write_cat_column(worksheet, col, level, num_format)
docs: Write the categories column(s) to *worksheet*. Categories start in
          the first column starting in the second row, and proceeding one
          column per category level (for charts having multi-level categories).
          A date category is formatted as a date. All others are formatted
          `General`.