That chart doesn't tell you anything about "spray and pray". Imagine Napoleon marching one of his immense tightly packed formations into the field of fire of a couple of miniguns. Spray 10 rounds a second at that kind of target and there's no need for prayr.
The reason the casualty rates started dropping afte the Civil War doesn't have anything to do with "spray and pray". It has to do with a change in tactics, and that change in tactics came about because of a change in technology.
In the Napoleonic wars and the Civil War the primary infantry weapon was a muzzle-loader. The ones in the Civil War were rifled and more accurate than Napoleon's but had the same limitation, which is that one has to stand to load them. If one has convenient cover (a tree to duck behind for example, or a trench with a firing step) then one can load with safety. If one does not have convenient cover then one has to just stand there in the middle of the battlefield presenting a target while one reloads.
After the Civil War muzzle loaders were abandoned in favor of breech loaders, which allow one to load in just about any position, thus allowing soldiers to crouch or lie prone and present a much smaller target. Also doctrine changed due to lessons learned in the Civil War (one of which is that marching big battalions into the field of fire of a prepared position against rifle and artillery fire is suicidal) and in WWI much of the activity was in the slow dance of prepared positions, moving the trenches back and forth, and there were more casualties from the diseases inherent in living in a trench than from enemy action, not because anyone "sprayed and prayed", but because far fewer soldiers presented themselves as easy targets.
After the Civil War the development of mobile radio changed things again, with infantry no longer slugging it out with hand-held weapons but serving a scouting function, and calling in artillery and air assets when contact is made. Infantry tends to keep much wider separation and try to avoid being seen, so again fewer and more difficult targets.
Now you can't even tell who the enemy is until he starts shooting at you.