If we suppose that we want to find the electric field at some point P. Let's consider a small volume element $ \Delta V_i$ , which contains an amount of charge $\Delta q_i$. The distance between charges within the volume element $\Delta V_i$ are much smaller than compared to $r$, the distance between $ \Delta V_i$ and $P$. So, the volume charge density $\rho(\vec r)$ as: $$\rho(\vec r)= \frac{dq}{dV}$$
This is the definition given for Volume Density Charge. Why is $\rho(\vec r)$ a function of $\vec r$ ?