This, from Crooks & Liars is an arresting graphic,
It is based on the info in the Timeline of United States military operations at Wikipedia.
That suggests to me that the graphic is in fact significantly over-inclusive for ordinary definitions of “war”. For example, the timeline includes this entry:
1873–96 – Mexico. United States troops crossed the Mexican border repeatedly in pursuit of cattle and other thieves and other brigands.
Was the US at war with Mexico for almost 25 years? Not as I understand it.
On the other hand, the graphic is also under-inclusive as the timeline excludes CIA-only and other ‘secret’ wars.
So a better title might have been, “Years in which the US engaged in acknowledged foreign military operations”. It would still be an arresting graphic.