Included in ASPdb-Gold is a Java based charting
module. Charting is implemented as a "Layout Object" produced by the
dbMagicLayout property. A Chart Object is always produced and stored in a Session
Variable. If template is used to display the chart object (dbSendTemplate), the
chart object session variable will be reset after the display. If template is
not used to display the chart then user is responsible to clean up this session
variable. Format of the Charting variable is the same as the other "Layout
Objects" - ASPdb_Layout_Unit_ID where Unit is the dbUnit and ID is the
There are (2) properties and (2)
Methods responsible for charts generation.
dbMagicLayout - Define Chart parameters
dbUserChartData - Define user hard-coded data
AspdbSendTemplate - Display chart using a
ASPdb - Produce chart and store in
There are 3 ways to produce a chart -
- User supplied data. User can supply all
the data set as hard-coded data and feed them into the datasets.
- Database columns. Datasets are
represented by the database "columns".
- Dataaset from URL. Similiar to user
supplied data except that data lists are stored in a URL. That means, you can
literally extract data of the X-axis from one URL at one end of the planet
and extract the Y-Axis data from the other URL at the other end of the planet.
- Set up a system DSN NWIND pointing to the Access Northwind database.
- Execute NWIND. Execute NWIND0.asp. If you do not see the following display,
you should check your setup.
- Look at the following asp code for this example -
X.dbSQL="SELECT DISTINCTROW ProductName, UnitPrice FROM Products Order by UnitPrice DESC"
X.dbMagicLayout="(;,#|)2;CHART_26,http://localhost,300,300,1,1;dataset0Labels|dataset0yValues;#0#|#1#;titleString=NorthWind Products Unit Price |titlefont=Arial,12,5|legendon|legendllX=0.0|legendllY=0.0| labelPosition=1|valueLabelsOn|percentLabelsOn|IconWidth=0.03|IconHeight=0.04| Xloc=0.6|Yloc=0.6|PieWidth=0.5|PieHeight=0.5| 3D"
The one area needed to be tuned is
the CodeBase. If you are working in the local
mode then use http://localhost. Otherwise,
set that to your production URL.
- Completion of this example will confirmed that your ASP-db2000 DLL setup
Common Errors causing chart failed to show -
- Use database data and "User Data" checkbox is checked.
- Use the wrong type of chart for datasets.
- Forget to increment dataset index.
- Forget to click dbMagicLayout to update properties.
- "Disabled Chart" is checked.
- Forget to clear (New) the file and inherit some leftover values.
- When entering values in the Axes grid, cursor must leave and positioned on
another row of cell or a <CR> key must be hit in order to register the value.
Just type the value in the cell without either of the above action will not
register the value.
Old browsers do not print Java charts !
For those old browsers that cannot print a Java
produced image, there is an option called gifButton to remedy the situation.
essentially, a button is generated together with the chart and clicking this
button will produce a gif image of the chart. See dbMagicLayout
Business Chart Type