# pgfplots Histogram with Automatically Calculated Percentage Bins

I have a CSV file. The CSV file contains several columns.

I want to plot a histogram that displays:

1. As the x axis: bins for the percentage of rows, that can be changed;
2. As the y axis: the cell values.

The end result would be a plot as such (This is just an example, the important point here is not the style of the plot, but how it operates. The data is also just an example. I have drawn ellipses to save me from drawing the entire plot by hand):

I have absolutely no idea where to even begin with this, save for providing the below MWE which is just a standard histogram.

\documentclass{standalone}
\usepackage{pgfplots}
\usepackage{filecontents}
\begin{filecontents*}{data.csv}
A,B
2,1
3,3
4,6
2,2
3,1
4,3
5,3
6,1
9,5
9,1
1,2
\end{filecontents*}
\usepackage{pgfplotstable}
\begin{document}

\begin{tikzpicture}
\begin{axis}[
ybar,
/pgf/number format/.cd,
use comma,
1000 sep={},
title={Percentage of Rows Containing Values},
xlabel={Percentage of Rows},
ylabel={Values},
x label style={at={(axis description cs:0.5,-0.1)},anchor=north},
y label style={at={(axis description cs:0.05,0.5)},anchor=south},
ytick distance=2,
width=\textwidth,
height=6cm,
ymin=0,
xticklabel interval boundaries
]