Friday, November 13, 2009

Do Have To Have A Prescription To Buy Catheters



partition Project JFreeChart which was released in 2000 is an open source library (Open Source) for Java, which allows you to create diagrams in a practical and simple. With JFreeChart can make different kinds of graphics ranging from the common types such as pie charts , bar charts, area charts, line charts, histograms, Gantt charts, more specific and less types often used as Candlestick, Wind and Wafer Map. For more information on this review Javadoc documentation and ChartFactory JFreeChart classes.

I. - Conditions

You must download download the JFreeChart package, optionally also recommend downloading the package JCommon. Even a partial version of it is already included in JFreeChart.

II-SETTING AND THE JFreeChart JCOMMON

then begin the steps to configure JFreeChart in NetBeans IDE:

  1. Once downloaded the package and the package JFreeChart JCommon unzip it into a directory on the PC. image
  2. Now open the NetBeans to configure JCommon libraries JFreeChart and therefore in NetBeans we go to the Tools menu and select Libraries: image
  3. We click on New Library and type "JCommon-1.0.16" as the name of the library then go to the tab Classpath → Add Jar / Folder and then seek the direction of JCommon downloaded above and select the file JCommon-1.0.16.jar: image image
  4. Do the same with the jar JFreeChart unload the eye in the jar we selected in this case is the lib folder. image
  5. done this and have set up libraries in JFreeChart and NetBeans JCommon; hour and we can generate a graph.
numcommentsAM NOTE: Keep in mind that we have only added the JAR but we have not generated the documentation of the files we have placed in the libraries, one way is by offering apache ant file but not yet placed because I'm reviewing it, when I run will update the blog or if anyone knows how to do it (build the javadoc) to support me I would appreciate the info.

III .- CREATING A GRAPHIC ON USING JFreeChart NETBEANS

  • create a new project, for this go to File menu → New Projct → Java Application and leave the Create Main Class enabled us to generate the main class (this is not essential for the generation can be placed on a graphics class by itself - just for sake of the example we are going to do so -)
  • Now let's add the libraries you have previously added to this new project, for this go to the Projects tab → Libraries → On node Right click and select add Library and jCommon JFreeChart libraries. image
  • And now in the Main class will post the following:
     jfreechart package, import 

    org.jfree.chart.ChartFactory;
    org.jfree.chart.ChartFrame import, import
    org.jfree.chart.JFreeChart ;
    org.jfree.data.general.DefaultPieDataset import;


    public class Main {public static void
    main (String [] args) {

    / / Create a dataset
    DefaultPieDataset DefaultPieDataset data = new ();
    data . setValue ("Categría 1", 43.2);
    data.setValue (Categría 2 ", 27.9);
    data.setValue (" Categría 3 ", 79.5);
    / / Create a Chart
    JFreeChart chart = ChartFactory.createPieChart (
    " JFreeChart Example ", / / \u200b\u200bTítrulo
    chart data,
    true, / / \u200b\u200bLegend
    true, / / \u200b\u200btrue
    ToolTips )
    / / create a kind of frame and display the JFreeChart it
    / / This constructor calls us the title of the chart and the chart created
    ChartFrame frame = new ChartFrame (First for javax0711 Chart ", chart);
    frame.pack ();
    frame.setVisible (true);
    }}



  • compile, run the application and ready and we have our first graph generated image

0 comments:

Post a Comment