The charge density is an equilibrium between diffusion (=thermal motion) and electricl attraction of charged particles.Its derivation is actually quite complex differental equation problem which needs statistical electron physics and field theory.
The curve for electric field is a brute force one dimensional solution of the basic electricity fact that the vector divergence of the field density in a given point is = charge density.in that point.
The potential curve is a calculation how much work is needed to move an unit charge through the given uneven electric field - it's got directly from the definition of the potential.
If you know those math laws, you should immediately notice that electrical field stength is the charge density integrated along X axis. The potential curve is the electric field integrated (=double integrated charge density curve).
This all needs about half year math and physics studies in lowest university level.
About measuring the potential:
If you have a diode, there's a potential difference (=voltage) between the terminals. In theory it could be detected if you had a sensitive enough contactless measuring method. Unfortunately as soon as you insert a normal voltmeter, the voltage vanishes - there's nothing that could produce continuous current that a normal voltmeter needs.