Pattern generalization is a key element of early algebra. However, it is also an area that causes significant problems for students as well as teachers, as it has proved challenging for elementary school students to understand the meaning of generalization. To address these problems, an intervention was done to introduce the graph and functions in relation to pattern generalizations in Grades 1 and 6. Working on graphs was new for these teachers because, in Sweden, graphs are normally not introduced in school until Grade 7. The results show that the introduction of graphs became a tool to understand and talking about a pattern generalization. As a result, their teaching on linear functions and patterns changed, and the implications of the results on mathematics education in elementary school are discussed in this paper.