Usefulness of x-ray diagnostics in dense-plasma gradients