
In this example, we will demostrate how to create a web page to show the monthly revenue for a given year. The user will select a year from a HTML form and press OK. The web server will query a database to obtain the necessary data, and return a web page containing the bar chart for the selected year.
The code for producing the HTML form is listed below. It outputs a drop down select list to allow the user to selecte a year. Based on the selected year, it uses an <IMG> tag with a ChartDirector script as the URL and the selected year as query parameter. The ChartDirector script will generate the chart image based on the selected year and deliver it to the browser.
[The following is available as "perldemo_cgi/dbdemo1_main.pl".]
Database Integration Demo (1)The example demonstrates creating a chart using data from a database. |