Calculating charge entered into a circuit element for a given time
From 2 to 4s, the 2A current increases the charge from 0 to 4C (coulombs) in 2 seconds.  From 4 to 8, the -1A current decreases the charge from 4 to 0C in 4 seconds.  That means it's 4 at T=4, and 0 at T=8.  That's a segment of the line 8-T, as is easily verified by extending it to the Y axis.

It may be more clear if you draw the charge over time.