We show that the Hausdorff dimension of any slice of the graph of the Takagi function is bounded above by the Assouad dimension of the graph minus one, and that the bound is sharp. The result is deduced from a statement on more general self-affine sets, which is of independent interest. We also prove that Marstrand’s slicing theorem on the graph of the Takagi function extends to all slices if and only if the upper pointwise dimension of every projection of the length measure on the x-axis lifted to the graph is at least one.