This is not the same as previous question at http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=491.0

It is easy with EJS if you just want to calculate the area for know function f(t).
Because what you want to do is calculate the integration of the function f(t).

Remember in evolution page when you type
dx/dt= v;
and
dv/dt=a; // or what ever function you have provided

What EJS did was integrate those two functions : v(t) and a(t) for you.
If you save the value x(t) before you let the time evolute as  xs and x(t) just after the end time of your integration as xn.
Then, xn-xs is the area that you want.

Actually, that is the meaning of the integration.
A lot of people learn how to calculate the integration or differentiation but did not really understand the meaning of it. 

If we only [b]REMEMBER[/b] what we have learn, we can only solve standard problem in the textbook.
To solve [u]REAL PROBLEM[/u] we need to apply what we have learn. And it require that we really [b]UNDERSTAND[/b] what we have learned.

Our current physics/mathematics education system address too much on calculation. We should focus more on CONCEPTUAL UNDERSTANDING. Let's why I put [b]Conceptual Learning of Science[/b] as major title for this web site.

I do not want to give you code for you to CUT and PASTE.
I hope you can solve it by yourself  with the above provided information.
We should teach our student to learn how to solve problem by themselves.
If we alway give them full detail of solution, they will only COPY and PASTE, and most of them will never learn how to solve the real problem.

May be you have thought: Why most of the simulations in this web site did not provide full detail information.
I did it in purpose.  I hope students/users can use the provided information and starts to think about the problem. If they could not figure it out, they can post question and I will provide more information. But I do not want to give full solution in the first place.
User will be able to [b]enjoy the joy of learning physics[/b] when s/he figure out the problem by her/himself.
What teacher should do is helping students to solve the problem, not to solve problem for students to remember.

[color=blue][b]A good physics teacher is not the one that students think the teacher is very good in physics.
A good teacher is the one who make students think they can be very good in physics. (students can solve physics problem by themselves.)[/b][/color]