5

I would create a java program to save a graph as image PNG for example with the following data:

x-axis: 01  02  03  04  05  06  07  08  09  10 
y-axis: 610 635 659 680 699 712 722 732 736 749
1
  • 1
    Your question is very broad meaning you're likely coming here too soon in your development process. I suggest that you break the big problem into small constituent steps and then try to solve each single step one at a time. Come back with your specific answerable question and your code if stuck after attempting this. Commented Apr 17, 2016 at 18:40

3 Answers 3

2

Theoretically you'd do that following these steps. Actually you have to first learn how to work with particular parts:

  1. Save these coordinates to an array or a List.
  2. Draw the content using javafx or any graphics library.
  3. Read the: https://community.oracle.com/thread/2450090?tstart=0
  4. In case of using javafx, you can capture its canvas with canvas.snapshot(..)
  5. Save the file using ImageIO.write(SwingFXUtils.fromFXImage(wim, null), "png", file);
  6. Hooray!

I recommend you to start with learning all about variables, data types, arrays, loops and lists/maps. Don't start with 2D drawing unless you can handle with data :)

Sign up to request clarification or add additional context in comments.

1 Comment

provided great source of information to start with javafx
1

Try dotty.exe to create graphs. Use graphviz open source.

Comments

1

Try to use JGraphX to create graphs in java. You could find maven dependency on github. To save tree graph try java JGraphx save as an image

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.