Try the standard anti-barbarian tactic: bring plenty of cavalry (equites) and charge from flanks.

Oh, and if the chariots go right through your hastati, you are not ranking them deep enough. Through a two-deep line, sure. Through a five-deep formation, hell no!