wmcnicho / QCP_SP2015

A quantum computing emulator made by undergraduates at University of Edinburgh
0 stars 0 forks source link

External Graph library #11

Open wmcnicho opened 9 years ago

wmcnicho commented 9 years ago

Hey all,

To save having to write a graphing library ourselves I've imported a JFreeChart open source library to our project. There is a bit of setup involved in getting this to work and I haven't tested it on another machine yet.

Here are the instructions I used in order to get the charts working.

  1. place jfreechart jars somewhere on your hard drive (i placed mine in C:\Eclipse\ext_libraries) (in our case this is in our git)
  2. Open Eclipse.
  3. Start a new Java project like you normally would.
  4. In the Package Explorer, right click your project and then click "Properties" (they forget to mention here that you should highlight "Java Build Path" in the left pane)
  5. In the window that comes up, click the "Libraries" tab
  6. Click "Add External JARs..."
  7. Navigate to the folder you created, and highlight jcommon-1.0.x.jar (which ever version you have). (ours is ...demo.jar and can be found in the root of the libarary)
  8. Click "Open"; this will add that jar to the list of external libraries.
  9. Repeat 6-8 for jfreechart-1.0.x.jar and jfreechart-1.0.x-experimental.jar (if you want to use the experimental features)
  10. You should now have access to the vast array of types, methods, objects, etc. that JFreeCharts provides; you'll of course, need to add "import org.jfree.chart.CLASS_YOU_WANT" to use them, but you should be able to copy and paste various samples available on the Net directly into Eclipse with little modification.