The category axis of this chart. In the case of an XY or Bubble
        chart, this is the X axis. Raises |ValueError| if no category
        axis is defined (as is the case for a pie chart, for example).
10549
def category_axis(self):
        
        catAx_lst = self._chartSpace.catAx_lst
        if catAx_lst:
            return CategoryAxis(catAx_lst[0])

        dateAx_lst = self._chartSpace.dateAx_lst
        if dateAx_lst:
            return DateAxis(dateAx_lst[0])

        valAx_lst = self._chartSpace.valAx_lst
        if valAx_lst:
            return ValueAxis(valAx_lst[0])

        raise ValueError('chart has no category axis')
852737
def _axis_levels(self, axis):
        
        ax = self._axis(axis)
        return 1 if not hasattr(ax, 'levels') else len(ax.levels)
279180
def get_axis_bin_index(self, value, axis):
        
        axis = self.get_axis_number(axis)
        bin_edges = self.bin_edges[axis]
        # The right bin edge of np.histogram is inclusive:
        if value == bin_edges[-1]:
            # Minus two: one for bin edges rather than centers, one for 0-based indexing
            return len(bin_edges) - 2
        # For all other bins, it is exclusive.
        result = np.searchsorted(bin_edges, [value], side='right')[0] - 1
        if not 0 <= result <= len(bin_edges) - 1:
            raise CoordinateOutOfRangeException("Value %s is not in range (%s-%s) of axis %s" % (
                value, bin_edges[0], bin_edges[-1], axis))
        return result
486526
def depth(self):
        
        categories = self._categories
        if not categories:
            return 0
        first_depth = categories[0].depth
        for category in categories[1:]:
            if category.depth != first_depth:
                raise ValueError('category depth not uniform')
        return first_depth
900491
def axis(self) -> Callable[[Any], Any]:
        
        axis_func = hist_axis_func(
            axis_type = self.axis_type
        )
        return axis_func
1314399
def _chart(self, x, y, chart_type, opts, style, label, options, **kwargs):
		
		if opts is not None:
			self.chart_opts = opts
		if style is not None:
			self.chart_style = style
		if label is not None:
			self.label = label
		self.x = x
		self.y = y
		if chart_type is None:
			return
		try:
			chart_obj = self._get_chart(chart_type, x, y, style=style,
										opts=opts, label=label,
										options=options, **kwargs)
			return chart_obj
		except Exception as e:
			self.err(e)
368284
def axis(self):
        """"""
        return getattr(
            self.colorbar.ax, self.axis_locations[self.position] + 'axis')
26367
def _get_chart_info(df, vtype, cat, prep, callers):
    
    maxval_raw = max(list(df["value.floor"]))
    curdf = df[(df["variant.type"] == vtype) & (df["category"] == cat)
               & (df["bamprep"] == prep)]
    vals = []
    labels = []
    for c in callers:
        row = curdf[df["caller"] == c]
        if len(row) > 0:
            vals.append(list(row["value.floor"])[0])
            labels.append(list(row["value"])[0])
        else:
            vals.append(1)
            labels.append("")
    return vals, labels, maxval_raw
122623
def categories(self, value):
        

        if value is not None:
            assert type(value) is dict, "'{0}' attribute: '{1}' type is not 'dict'!".format("categories", value)
            for key in value:
                assert type(key) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format(
                    "categories", key)
        self.__categories = value
513322
def categories_ref(self):
        
        categories = self._chart_data.categories
        if categories.depth == 0:
            raise ValueError('chart data contains no categories')
        right_col = chr(ord('A') + categories.depth - 1)
        bottom_row = categories.leaf_count + 1
        return "Sheet1!$A$2:$%s$%d" % (right_col, bottom_row)
1177317
def iter_xCharts(self):
        
        plot_tags = (
            qn('c:area3DChart'), qn('c:areaChart'), qn('c:bar3DChart'),
            qn('c:barChart'), qn('c:bubbleChart'), qn('c:doughnutChart'),
            qn('c:line3DChart'), qn('c:lineChart'), qn('c:ofPieChart'),
            qn('c:pie3DChart'), qn('c:pieChart'), qn('c:radarChart'),
            qn('c:scatterChart'), qn('c:stockChart'), qn('c:surface3DChart'),
            qn('c:surfaceChart')
        )

        for child in self.iterchildren():
            if child.tag not in plot_tags:
                continue
            yield child
855343
def fit(self, X, y=None):
        
        self.columns_ = X.columns
        columns = self.columns
        if columns is None:
            columns = X.select_dtypes(include=["category"]).columns
        else:
            for column in columns:
                assert is_categorical_dtype(X[column]), "Must be categorical"

        self.categorical_columns_ = columns
        self.non_categorical_columns_ = X.columns.drop(self.categorical_columns_)

        if _HAS_CTD:
            self.dtypes_ = {col: X[col].dtype for col in self.categorical_columns_}
        else:
            self.dtypes_ = {
                col: (X[col].cat.categories, X[col].cat.ordered)
                for col in self.categorical_columns_
            }

        return self
1006624
def _convert_axes(self):
        
        for axis in self.obj._AXIS_NUMBERS.keys():
            new_axis, result = self._try_convert_data(
                axis, self.obj._get_axis(axis), use_dtypes=False,
                convert_dates=True)
            if result:
                setattr(self.obj, axis, new_axis)
1329783
def values(self):
        
        # TODO: Figure out how to intersperse pairwise objects for columns
        # that represent H&S
        return [
            _ColumnPairwiseSignificance(
                self._slice,
                col_idx,
                self._axis,
                self._weighted,
                self._alpha,
                self._only_larger,
                self._hs_dims,
            )
            for col_idx in range(self._slice.get_shape(hs_dims=self._hs_dims)[1])
        ]
958340
def _do_convert_categoricals(self, data, value_label_dict, lbllist,
                                 order_categoricals):
        
        value_labels = list(value_label_dict.keys())
        cat_converted_data = []
        for col, label in zip(data, lbllist):
            if label in value_labels:
                # Explicit call with ordered=True
                cat_data = Categorical(data[col], ordered=order_categoricals)
                categories = []
                for category in cat_data.categories:
                    if category in value_label_dict[label]:
                        categories.append(value_label_dict[label][category])
                    else:
                        categories.append(category)  # Partially labeled
                try:
                    cat_data.categories = categories
                except ValueError:
                    vc = Series(categories).value_counts()
                    repeats = list(vc.index[vc > 1])
                    repeats = '-' * 80 + '\n' + '\n'.join(repeats)
                    # GH 25772
                    msg = """
Value labels for column {col} are not unique. These cannot be converted to
pandas categoricals.

Either read the file with `convert_categoricals` set to False or use the
low level interface in `StataReader` to separately read the values and the
value_labels.

The repeated labels are:
{repeats}
"""
                    raise ValueError(msg.format(col=col, repeats=repeats))
                # TODO: is the next line needed above in the data(...) method?
                cat_data = Series(cat_data, index=data.index)
                cat_converted_data.append((col, cat_data))
            else:
                cat_converted_data.append((col, data[col]))
        data = DataFrame.from_dict(OrderedDict(cat_converted_data))
        return data
620805
function () {
                        var t = d3.select(this).selectAll("text");
                        if (!axis.measure && axis._max > 0) {
                            if (axis.position === "x") {
                                t.attr("x", (chartWidth / axis._max) / 2);
                            } else if (axis.position === "y") {
                                t.attr("y", -1 * (chartHeight / axis._max) / 2);
                            }
                        }
                        if (axis.categoryFields && axis.categoryFields.length > 0) {
                            // Off set the labels to counter the transform.  This will put the labels along the outside of the chart so they
                            // don't interfere with the chart contents
                            if (axis === firstX && (firstY.categoryFields === null || firstY.categoryFields.length === 0)) {
                                t.attr("y", chartY + chartHeight - firstY._scale(0) + 9);
                            }
                            if (axis === firstY && (firstX.categoryFields === null || firstX.categoryFields.length === 0)) {
                                t.attr("x", -1 * (firstX._scale(0) - chartX) - 9);
                            }
                        }
                        return this;
                    }
89647
def categories(self, value):
        

        if value is not None:
            assert type(value) is dict, "'{0}' attribute: '{1}' type is not 'dict'!".format("categories", value)
            for key, element in value.iteritems():
                assert type(key) is dict, "'{0}' attribute: '{1}' type is not 'dict'!".format("categories", key)
                assert type(element) is list, "'{0}' attribute: '{1}' type is not 'list'!".format(
                    "categories", element)
        self.__categories = value