You can easily add graphs in Ebase forms using a open source chart library “Jfreechart”. I have developed a sample Ebase form to demonstrate this. The following are the steps to add graphing capability to Ebase.
- 1. Download the Graph_Demo.zip file from http://www.ebaseftp.com/forum/forumfiles/Graph_Demo.zip
2. Unzip the Graph_Demp.zip into a temporary folder.
3. Copy the GRAPH_DEMO.xml into <ufs>\UfsServer\transport folder
4. Import this into your Ebase environment via the Ebase Designer.
5. Open the GRAPH_Button230_UPDATETABLE_001 script and change ‘C:/Ebase_versions/Ebase_3_4_0_Beta_3/UfsServer/tomcat/webapps/ufs/’ to the correct location of the web-app on your Ebase server.
6. Copy the Graphing.class file into <ufs>\UfsServer\tomcat\webapps\ufs\WEB-INF\classes\com\ebasetech\ufs\customresources. (Note: If you do not have the folder structure, please create it)
7. Copy the .jar files inside \lib folder into <ufs>\UfsServer\tomcat\webapps\ufs\WEB-INF\lib folder
8. Copy the Graphing.properties file into <ufs>\UfsServer\tomcat\webapps\ufs\WEB-INF\classes folder
9. Create a ‘charts’ folder inside <ufs>\UfsServer\tomcat\webapps\ufs\shared\ folder.
10. Re-start your Ebase Server, start Designer, navigate to Business Projects -> GRAPHING
11. Run the GRAPH form inside the GRAPHING Business Project.
12. Graphing.java file is for your reference. If you make any enhancement to this file please send it back to us so that we can share it with others.
1. The form passes the required values to the custom resource 'Graphing'.
2. This custom resource uses the Jfreechart java library to produce the required graph image and creates a .PNG file in the <ufs>\UfsServer\tomcat\webapps\ufs\shared\charts folder.
3. The custom resource returns the unique file name for the .PNG file which is assigned to a Ebase form field “CHART_IMAGE”
4. This value is then used inside a label field to display a image by using HTML
Important Note:
The gnujaxp.jar file which needs to be added to Ebase for this graphing tool may cause problems with Web Services (see log number 332425 on the Ebase Customer Portal).