Introduction to ASP-db Charting Pro | Enterprise | Gold

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 dbMagicLayout ID.

There are (2) properties and (2) Methods responsible for charts generation.

dbMagicLayout - Define Chart parameters

dbUserChartData - Define user hard-coded data sets.

AspdbSendTemplate - Display chart using a template.

ASPdb - Produce chart and store  in session variable.

There are  3 ways to produce a chart -

  1. User supplied data. User can supply all the data set as hard-coded data and feed them into the datasets.
  2. Database columns. Datasets are represented by the database "columns".
  3. 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.

Examples -

  1. Set up a system DSN NWIND pointing to the Access Northwind database.
  2. Execute NWIND. Execute NWIND0.asp. If you do not see the following display, you should check your setup.
  3. Look at the following asp code for this example -
    <%
    Set X=Server.CreateObject("AspDB.DB")
    X.dbQuickProps="1;NWIND;;grid;4,,lightgreen;;;ACCESS;5;1;1"
    X.dbSQL="SELECT DISTINCTROW ProductName, UnitPrice FROM Products Order by UnitPrice DESC"
    X.dbDisplay=false
    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"
    X.ASPdb
    response.write(Session("ASPdb_Layout_1_2"))
    %>
    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.
  4. Completion of this example will confirmed that your ASP-db2000 DLL setup is OK.

Common Errors causing chart failed to show -

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 for details.

Business Chart Type