An analysis of the process of generating a temporary picture on the page in JFreeChart

xiaoxiao2021-03-06  51

I have also studied that JFreeChart has some days. There are many articles that are entitled online, but there is not much more in-depth. I also started from one or two entrance articles, and later I rely on my own source code to study Demo. Because I am doing more based on the B / S structure, the picture is displayed using org.jfree.chart.servlet.displaychart, I showed the relevant source code today, and the process is as follows. In a multi-example of online, first, the service () method of DisplayChart calls ServletUtilities's SaveChartArtArtArtASPNG (JFreechart Chart, Int Width, In this process, the SaveChartAstASPNG method is the name of the temporary file, and then call ORG .jfree.Chart.Chartutilities SavechartaSpng (File File, JFreechart Chart, Int Width, Int Height, ChartRenderingInfo Info, Boolean Encodealpha), generate images in the temporary folder of the server, next is to put the picture file with org.jfree.Chart .Servlet.Chartdeleter Bind (That is to pass the image file name to this class), the ChartDeleter class inherits the HttpSessionBindingListener interface, the main role is to delete the picture in the temporary folder when the user session invalid, this class is existed in Session middle. Finally, the sendtempfile (file file, httpservletresponse response, string mimetype) of servletutilities is called. It is to say that the picture is stored in the temporary folder stored in the server, and the program will automatically delete the image after the user session is invalid. I have been watching online for a long time. There are a lot of people asking questions about JFreechart, but asking, there is less, it is difficult to have one

forum

It is unfortunately discussed JFreeChart, but unfortunately, if possible, I will share my accumulation and everyone, I hope to get more friends who love JFreechart!

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

New Post(0)