dbUserChartData

There are two ways to define the datasets of a java based chartx in ASPdb2000 - database and user defined. This property defines the user defined datasets. If this property is not blank then the ASPdbChart (Method) and dbMagicLayout (Property) will produce a chart based on this property. Charts are stored in a session variable in the format of Session("aspdb_Layout_Unit_ID"). ID is a unique number (assigned by user) of the chart object  generated in the same module. In example #1, the object is "X" and it generates two chart objects stored in the session variables. The only different attributes of these two charts are the chart type (24=Pie and 16=IndColumn) and title. 

Property Syntax

Obj.dbUserChartData="(~,)set1pt1,set1pt2...~ set2p1,set2pt2...~repeat

Parameters

Parameters

Default Value

Description

(~,) (~,) Dataset and datapoint delimiter. The Dataset Group delimiter is taken from the chartDelimiter of the dbMagicLayout property.
SetxPt1,SetxPt2..   Data points of a dataset separated by the field delimiter. The max number of datasets is the same as the MagicLayout (Chart).

Example

<%
'Module=X UNIT=9 ID=2
Set X=Server.CreateObject("ASP.DB")
X.dbUnit=9
X.dbUserChartData="Frank,Polly,Ivy,Irene,Iris,Amanda~50,42,19,16,13,10"
X.dbMagicLayout="(;,#)2;CHART_24,http://localhost/javachart,300,300,1,1;dataset0Labels~dataset0yValues;#0#~#1#;titleString=Frank's Family in a Pie~titlefont=Arial,12,5~legendon~legendllX=0.0~legendllY=0.0~ labelPosition=1~valueLabelsOn~percentLabelsOn~IconWidth=0.03~IconHeight=0.04~ Xloc=0.5~Yloc=0.6~PieWidth=0.5~PieHeight=0.5~ 3D"
X.AspDBUserChart

'Module=X UNIT=9 ID=3
X.dbMagicLayout="(;,#)3;CHART_16,http://localhost/javachart,300,300,1,1;dataset0Labels~dataset0yValues;#0#~#1#;titleString=Frank's Family in a bar~titlefont=Arial,12,5~legendon~legendllX=0.0~legendllY=0.0~ labelPosition=1~valueLabelsOn~percentLabelsOn~IconWidth=0.03~IconHeight=0.04~ Xloc=0.5~Yloc=0.6~PieWidth=0.5~PieHeight=0.5~ 3D"
X.AspDBUserChart
response.write(session("aspdb_Layout_9_2") & "&nbsp;")
response.write(session("aspdb_Layout_9_3"))
%>


Looks like a lot of work done for a few lines of code! How are these charts being stored? Are they going to jam up the server's disk space if a lot of surfers are generating these charts? In order to help the webmaster sleep better, the HTML source of this page containing the two charts is listed. Nothing is stored on the server!

Output HTML suorce

<applet code=javachart.applet.spinningPie.class codebase=http://localhost/javachart width=300 height=300>
<param name=dataset0Labels value='Frank,Polly,Ivy,Irene,Iris,Amanda'>
<param name=dataset0yValues value='50,42,19,16,13,10'>
<param name=titleString value="Frank's Family in a Pie">
<param name=titlefont value='Arial,12,5'>
<param name=legendon value='ASP-db'>
<param name=legendllX value='0.0'>
<param name=legendllY value='0.0'>
<param name=labelPosition value='1'>
<param name=valueLabelsOn value='ASP-db'>
<param name=percentLabelsOn value='ASP-db'>
<param name=IconWidth value='0.03'>
<param name=IconHeight value='0.04'>
<param name=Xloc value='0.5'>
<param name=Yloc value='0.6'>
<param name=PieWidth value='0.5'>
<param name=PieHeight value='0.5'>
<param name=3D value='ASP-db'>
</applet>&nbsp;<applet code=javachart.applet.indColumnApp.class codebase=http://localhost/javachart width=300 height=300>
<param name=dataset0Labels value='Frank,Polly,Ivy,Irene,Iris,Amanda'>
<param name=dataset0yValues value='50,42,19,16,13,10'>
<param name=titleString value="Frank's Family in a bar">
<param name=titlefont value='Arial,12,5'>
<param name=legendon value='ASP-db'>
<param name=legendllX value='0.0'>
<param name=legendllY value='0.0'>
<param name=labelPosition value='1'>
<param name=valueLabelsOn value='ASP-db'>
<param name=percentLabelsOn value='ASP-db'>
<param name=IconWidth value='0.03'>
<param name=IconHeight value='0.04'>
<param name=Xloc value='0.5'>
<param name=Yloc value='0.6'>
<param name=PieWidth value='0.5'>
<param name=PieHeight value='0.5'>
<param name=3D value='ASP-db'>
</applet>

Notes

Refer to The following property of the dbMagicLayout -

Syntax 4
Obj.dbMagicLayout="(;,#~)ID; CHART_???, Codebase, Width, Height, Start, Interval, Stop;
ChartDataSet; DataSetMagicMacro; PARAMS"

This property, if it exists (not blank) will be used as the ChartDataSet field in the above syntax.

When dealing with Java applets, the localhost path is very critical. Always adjust this parameter to fit your application.

 See Case Study #42 for Drill down chart example using dbUserChartData