Results 1 to 10 of 10
  1. #1
    natasha.c is offline Member
    Join Date
    Oct 2016
    Posts
    5
    Rep Power
    0

    Default plotting a graph

    hello... i am doing a project based on ecg data and i need to display the readings using java applet. i'm completely new to java. i am using eclipse. can someone help me with the code to display the data in form of a graph? the data is stored in a text file.
    thanks in advance :)
    Last edited by natasha.c; 10-11-2016 at 11:23 AM.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: plotting a graph

    What have you got so far?

    Can you open the file and read it in line by line?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    natasha.c is offline Member
    Join Date
    Oct 2016
    Posts
    5
    Rep Power
    0

    Default Re: plotting a graph

    yes.. so far i have been able to read the file and store the values in an array. the next step is to display that ecg data.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: plotting a graph

    OK.
    So what sort of graph do you want to do?
    Have you looked for any graphing frameworks that would work with Swing?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    natasha.c is offline Member
    Join Date
    Oct 2016
    Posts
    5
    Rep Power
    0

    Default Re: plotting a graph

    just a simple line graph connecting points. and i did look into swing graphics but didn't understand it that much. could u tell me how to go about it? i have deadline of 13th.

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: plotting a graph

    So what about JFreeChart?
    Unless you have specific restrictions that would be my choice.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: plotting a graph

    Is this a programming class or did you just decide to try Java? You said that you looked into Swing graphics. But has your instructor
    talked about using JPanel's, JFrame's, Graphics contexts, etc? Depending of the nature of the data, this could be involved. For example,
    you might need to scale the data to fit the panel. It doesn't make sense to me that a class assignment goes beyond what has been taught in class.

    Of course, if you just need a way to plot some data you could also try using either Excel or one of the open, Java based equivalents.

    Regards,
    Jim
    Last edited by jim829; 10-11-2016 at 06:43 PM.
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  8. #8
    natasha.c is offline Member
    Join Date
    Oct 2016
    Posts
    5
    Rep Power
    0

    Default Re: plotting a graph

    @Tolls sure i'll look into it. as such i have no restrictions.

  9. #9
    natasha.c is offline Member
    Join Date
    Oct 2016
    Posts
    5
    Rep Power
    0

    Default Re: plotting a graph

    @Jim829 no it isn't a programming class. this is for my final year project. my mentor has not given any instructions as such because that's not his field of expertise. i took up the software part of the project because i want to learn programming as much as i can. so far i could manage. but i don't know how java applet works, but i'm trying.
    my job next is to plot the data from the text file using java only.

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: plotting a graph

    Java is not really a pick up and go language, like some scripting ones.
    And to throw in learning Swing, and either another framework or drawing to the graphics context, is quite a lot to take on board.

    Does it have to be on a web page?
    Removing Applets removes one technology at least (though you'd still have Swing).

    Also, since you are not restricted, you might look at JavaFX instead of Swing.
    It has a built in chart.

    I don't normally recommend GUI tools, but at least JavaFX was designed with one in mind, so there's always the scene builder.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Plotting a graph
    By cet_1990 in forum Java 2D
    Replies: 2
    Last Post: 12-20-2011, 11:11 PM
  2. plotting graph
    By dhruvaharsha in forum AWT / Swing
    Replies: 1
    Last Post: 02-06-2010, 07:04 PM
  3. Help in plotting graph
    By javafanatic in forum New To Java
    Replies: 20
    Last Post: 12-07-2009, 12:55 PM
  4. Help regarding 3D graph plotting...
    By Megatron in forum New To Java
    Replies: 1
    Last Post: 05-21-2009, 04:26 PM
  5. graph plotting
    By sirine in forum New To Java
    Replies: 5
    Last Post: 01-25-2009, 03:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •