there are two common ways to display a graph on a html page.
the first is the graph is an image created on the server. on a razor page this would be an <img> the with the url being an action that returns a file that is an image (typically jpeg). you can pass parameters on the url. The server would use the graphing library of its choice to create the image
the second (especially if interactive) is a client side grading solution as suggested in the prevues post.