Take near JFreechart (1)

xiaoxiao2021-03-06  60

Recently, a graphic project is made, mainly with an open source JFreechart, its logo image is a cute chimpanzee, its website: http://www.jfree.org/jfreechart/index.html.

You can download its source code, DOC documentation, and examples on the website (the latest version is 0.9.21). Download, you can run a Demo's JAR file directly in the CMD console window: java -jar jfreechart-0.9.21-demo.jar. You can see its window example graphics, simply handle the source code of your example, his two support packages: gnujaxp.jar. JCOMMON-0.9.5.jar. The first package seems to be used, and if you use Jdom and JBuilder's Tomcat, do development may encounter a strange mistake of JDOM, and the web page can't start, then you will put this package in the system. Remove, does not affect the use of JFreechart. Specific reasons are unclear (at that time, this problem helped me for a long time, and finally found this solution on an foreigner forum). Add auxiliary package and JFreeChart package to your classpath, you can start JFreechart tour with JBuilder or Eclipse.

Yes, you should talk about the application range of JFreeChart, you can use the window design dynamic graphics, web-side dynamic graphics (JSP / servlets), Applet graphics, their usage, and some small examples. I will go to this, mainly to sum up some things that I have learned and some of myself.

It can be said that JFreeChart is a very good project. It can be seen from its source code. This project seems to be started in 2000, until now, the final revision of the source code seems to be July 2004. It achieves a perfect combination of dynamic data graphics. It is a development kit for pure Java. JFreeChart can not only achieve pie charts, 拄 拄 图, stack charts, line diagrams, etc. Hash map, candle graphics, various combinations, multi-coordinate maps, etc., the source code of JFreechart is very clear, downloading its DOC documentation can be very good to see its class structure, it fully implements an abstraction The avatar of the graphic object, I feel very good for its OOP ideas (of course, there are also some places to write unreasonable, but there is no perfect thing in the world).

With an example: such as a graphic object (JFreeChart), it is made by Title (title, subtitle ,,,,), plot (drawing structure of graphics), Background, Toolstip (Graphics toolbar), etc. The main object is composed, and take a Plot object, which includes renderer objects (graphical drawing unit - drawing domain) Datset (data source of graphics), Domainaxis, Rangeaxis (Y-axis), etc. The series of objects are composed, while the AXIS (axis) is made up of some columns of tarants, labels, spacing, scale units, etc., always refined to the bottom Java AWT package and SWING STROKE, etc. Those foundation objects. This abstract degree of deepening and abstract reasonable levels are admired! In the development, some classes in JFreechart, I boldly took it out, put it in my own project, such as the class and JDBC data source class under its org.jfree.chart.ui, which, I can modify these classes according to my own needs, don't affect the taste of JFeechart, and I also master its flexibility. After all, I need to modify the source code of JFreechart. I will find it. This kind of practice is really awkward :).

The project is actually simple, and the graphics are custom graphically generated in a C / S structure graphics designer, then upload the template to the web side, the user selects the template according to the SQL statement of the report, select the column to generate the graph, generate graphics, Of course, most of the parameters of the graph can be modified on the web end. Do not save the template, the template provides data sources, graphical default parameters, graphical types and other functions.

. . . . . to be continued. . . . . . . . (Recently busy, I am afraid that I have no time to summarize ... depressed ........)

转载请注明原文地址:https://www.9cbs.com/read-84012.html

New Post(0)