Best way to redraw a graph

I’m new to Juce and am working on creating a piece of graphing software where you can change values on a slider and it updates the graph. I have the graph and sliders built, but am having a hard time updating the graph. I draw the graph in the paint function using some code another person, wrote called araz graph ( I am trying to paint over it with the new values using the repaint function, but since it’s not a native component I don’t know if repaint will work? How would you generally repaint over something thats not a native JUCE component? Thanks!

Edit: I was overwriting my change in data in the paint function, but it was updating. Thats my bad. Thanks to anyone who read this!