Package COM. mengya. test. jfreechart; import Java. AWT. font; import javax. swing. jpanel; import Org. jfree. chart. chartfactory; import Org. jfree. chart. chartpanel; import Org. jfree. chart. jfreechart; import Org. jfree. chart. axis. categoryaxis; import Org. jfree. chart. plot. categoryplot; import Org. jfree. chart. plot. plotorientation; import Org. jfree. chart. title. texttitle; import Org. jfree. data. category. categorydataset; import Org. jfree. data. category. defaultcategorydataset; import Org. jfree. UI. applicationframe;/*** jfreechart bar chart in the swing format ** @ author **/@ suppresswarnings ("serial") public class jfreecharttest2 extends applicationframe {public jfreecharttest2 (String title) {super (title); this. setcontentpane (createpanel ();} Private Static categorydataset createdataset () {defacategcategorydataset dataset = new defaultcategorydataset (); // dataset. setvalue (10, "", "Administrator"); // dataset. setvalue (15, "", "market personnel"); // dataset. setvalue (35, "", "Developer"); // dataset. setvalue (12, "", "other personnel"); dataset. setvalue (10, "AA", "Administrator"); dataset. setvalue (15, "BB", "market personnel"); dataset. setvalue (35, "cc", "Developer"); dataset. setvalue (12, "DD", "other personnel"); Return dataset;} Private Static jfreechart createjfreechart (categorydataset dataset) {/*** construct jfreechart * // jfreechart // = chartfactory. createbarchart ("organization chart of a company", "Personnel Distribution", "number of personnel", dataset, plotorientation. vertical, false); // jfreechart // = chartfactory. createbarchart ("organization chart of a company", "Personnel Distribution", "number of personnel", dataset, plotorientation. vertical, true, false, false); jfreechart = chartfactory. createbarchart3d ("organization chart of a company", "Personnel Distribution", "number of personnel", dataset, plotorientation. vertical, true, false, false);/*** set jfreechart attributes */jfreechart. settitle (New texttitle ("organizational structure of a company", new font ("", Font. bold + font. italic, 20); categoryplot plot = (categoryplot) jfreechart. getplot (); categoryaxis = plot. getdomainaxis (); categoryaxis. setlabelfont (new font ("", Font. roman_baseline, 12); Return jfreechart;} public static jpanel createpanel () {jfreechart chart = createjfreechart (createdataset (); return New chartpanel (Chart );} public static void main (string [] ARGs) {jfreecharttest2 chart = new jfreecharttest2 ("organization chart of a company"); chart. pack (); chart. setvisible (true );}}