

Caffeine leaves the blood in a steady halving. With a half-life of 5 hours, half of it is gone after 5 hours, three quarters after 10. A 200 mg coffee at 15:00 leaves 200 x 0.5^(8/5) = about 66 mg at 23:00. That is more than a cup of tea or a can of cola still active when you lie down. The 5 hour figure is the average for adults; your own number can be 3 hours or 10.
The bars are a simple model, not measurements. A 200 mg coffee is about two small brewed cups; shops vary a lot. Check the label of your drink.