Upvote:6
You cannot do this trip on a transit visa. You will need to obtain a Schengen entry visa.
This is because Athens and Barcelona are both in the Schengen area. Therefore the flight between them counts as an internal flight. You will need to clear immigration in Athens in order to board the flight to Barcelona.
More information can be found in the answer to this question.