r/learnreactjs • u/clobber88 • Jun 15 '22
Question ReactJS + ChartJS But My Graph Does Not Update
I' trying to learn NodeJS, ReactJS, and ChartJS by creating a simple interest calculator with variable inputs (how much money, interest rate, and duration). Everything looks like it is working, but when I make changes to the sliders, the graph does not change. Looking at the console.log for the arrays, everything is changing but not reflected in the graph. I have posted a picture first followed by some code snippets. I'm sure I'm missing something simple.
Also Im sorry if pasting the code comes out terrible

My code starts with SimpleCalculator.js . I first return the SimpleCalculatorControls (sliders) that you see on the top of the page. yearlyBalance contains both the year number and the balance for each year of the duration. That is, it holds two arrays. This is passed to Simple Graph which is pasted below.
Edit: I removed the terrible format code. Here is the pastebin: https://pastebin.com/7am5yceQ
1
u/cobbs_totem Jun 15 '22
What does SimpleCalculatorControls look like?
0
u/[deleted] Jun 15 '22
[deleted] — view deleted comment