Easy400 home
Public Source
 

Introduction


•Line charts

•Radar charts

•Bar charts

•Polar, Pie & Doughnut
 charts

•Chartit

•Appendix A- Options
 

Download
 
 

 
GRAPHIT
A simple way to create charts with your CGI programs
by Giovanni B. Perotti (Italy)
One day I stumbled in a help request from a guy who was having troubles with some graphic chart driven by some CGI program. As a matter of fact there was no problem and I happened to enjoy a beautiful line chart.
I tried to understand what it was: some javascript based over a "new" HTML 5 tag, "canvas".
After understanding a bit of it, I was able to master a splendid line chart.

That is what this utility is about.

Though I believe that many IBM i experts are miles ahead of me, still I think that some thousand less expert people would love to start with such easy charts for use in their CGI programs.
Should I stumble in more interesting tools, I would publish them over time.

 

Our charts are based on some Jascript code originated by Nick Downie, at that time available at no charge from page Chart.js and currently included in our utility GRAPHIT.
Chart.js documentation at page http://www.chartjs.org/docs/ provided a complete reference as to the parameters used to generate different type of charts.

Chart.js javascript, once properly invoked, fills a "canvas" area whith the requested chart ("canvas" is a HTML5 tag, see the following W3 Schools HTML pages:

In the next pages we

  • go across the different types of charts, providing examples of CGI programs able to generate those charts
  • suggest the use of a general purpose CGI program (CHARTIT), able to generate whatever type of charts by providing the required input variables. A productivity tool that allows your CGI programs to generate zero cost charts in a few minutes.

1-Prerequisites

  • Compiler ILE RPG IV, product 57xxWDS, opt. 31
  • Easy400.net-provided utility CGIDEV2.

2-Installation

  • If you already installed a previous version of library GRAPHIT, rename it GRAPHITOLD.
    You may delete library GRAPHITOLD upon successful installation of the new version of library GRAPHIT.
  • Download file graphit.zip from the Easy400 download page and unzip it.
  • Follow the Readme.txt instructions to upload and to restore library GRAPHIT.
  • On the iSeries run the following procedure:
    STRREXPRC SRCMBR(INSTALL) SRCFILE(GRAPHIT/QREXSRC)

3-Maintenance

This utility is maintained on request, both for applying fixes and for adding enhancements.
Send your requests to the author.
To know what is new, just take a look at its Change Log.

4-HTTP instance

In order to enable your CGI HTTP instance to support GRAPHIT, you must add the HTTP directives available in this IFS stream file /graphit/HTTPdirectives.txt.
If you want, you may add these directives to your CGIDEV2AP http instance IFS configuration stream file /cgidev/conf/httpd.conf.


next page