X-ray flux and anisotropy produced by galactic cosmic-ray electrons