• Login
  • Register
  • Login Register
    Login
    Username:
    Password:
  • Home
  • Members
  • Team
  • Help
User Links
  • Login
  • Register
  • Login Register
    Login
    Username:
    Password:

    Quick Links Home Members Team Help
    Tendo City Tendo City: Metropolitan District Ramble City Graphing Compound Interest in Java

     
    • 0 Vote(s) - 0 Average
    Graphing Compound Interest in Java
    Laser Link
    Offline

    Moderator

    Posts: 1,352
    Threads: 54
    Joined: 11-23-1999
    #8
    23rd April 2005, 4:49 PM
    You're probably way past this point already Derek, but if you haven't got around to it yet, this might save you some time.
    The first <a href="http://www.sci.usq.edu.au/staff/leighb/graph/examples/example1.html">example</a> looks like it can do what you want. Assuming I am right in what you want. :) My understanding is you want to keep track of how much interest you pay over time or something like that, so this should work okay.

    It looks like he uses that data array to store each point of the graph (I think it's a parabola):

    for(i=j=0; i<np; i++,j+=2) {
    data[j] = j-np;
    data[j+1] = 60000 * Math.pow( ((double)data[j]/(np-2) ), 2);
    }


    Sets those DataSet objects (data1 and data2) with the curve info here:

    data1 = graph.loadDataSet(data,np);

    (np is just the max size of the array, I don't know why he didn't declare it <b>final</b>)

    And finally sets the axis with the DataSets and the graph names and units.

    xaxis = graph.createAxis(Axis.BOTTOM);
    xaxis.attachDataSet(data1);
    xaxis.attachDataSet(data2);
    .
    .
    .

    Really the only thing you need to even touch is the part where he loads the data array with the data points he wants to graph. You should be able to do it pretty easily. I can't say I've done a lot with Applets (hopefully you have), so I don't know if any of that needs to be changed or if it will automatically pull up a browser and run the applet there. Sorry.

    [edit]I don't know why this board won't display all the code. It keeps cutting off the for loop.[/edit]
    Reply
    Reply
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)



    Messages In This Thread
    Graphing Compound Interest in Java - by The Former DMiller - 21st April 2005, 11:39 AM
    Graphing Compound Interest in Java - by OB1 - 21st April 2005, 1:51 PM
    Graphing Compound Interest in Java - by The Former DMiller - 21st April 2005, 7:26 PM
    Graphing Compound Interest in Java - by Laser Link - 22nd April 2005, 4:27 PM
    Graphing Compound Interest in Java - by The Former DMiller - 22nd April 2005, 4:29 PM
    Graphing Compound Interest in Java - by OB1 - 22nd April 2005, 4:30 PM
    Graphing Compound Interest in Java - by Laser Link - 23rd April 2005, 4:26 PM
    Graphing Compound Interest in Java - by Laser Link - 23rd April 2005, 4:49 PM
    Graphing Compound Interest in Java - by The Former DMiller - 23rd April 2005, 9:29 PM
    Graphing Compound Interest in Java - by Laser Link - 25th April 2005, 8:08 AM
    Graphing Compound Interest in Java - by OB1 - 25th April 2005, 9:26 AM

    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Toven Solutions

    Home · Members · Team · Help · Contact

    408 Chapman St. Salem, Viriginia

    +1 540 4276896

    etoven@gmail.com

    About the company Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    Linear Mode
    Threaded Mode