For a real analytic periodic function ๐: โโโ, an integer ๐โฅ2 and ๐โ(1/๐,1), we prove the following dichotomy for the Weierstrass-type function ๐(๐ฅ)=โ_{๐โฅ0} ๐^๐ ๐(๐^๐ ๐ฅ): Either W(x) is real analytic, or the Hausdorff dimension of its graph is equal to 2+log๐๐. Furthermore, given b and ๐, the former alternative only happens for finitely many ๐ unless ๐ is constant.