As an alternative to making interactive 2D graphs by writing JavaScript and using JSXGraph, you can draw plots right within the main code. This is easier to get started with, and it allows you to draw in 3D, but students can't interact with the resulting graphs.
See the pages below for a quick example and a list of functions:
Most of these functions were ported from the Racket language's Plot library, so it may be helpful to see examples in their docs.