Fixed binning logic for categorical histogram when combined with UI