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.