Creation of the diagram