function <%
' ###################################################
' # # Barchart #
' # # Class to draw bar charts in ASP applications #
' # # Author:anton Bawab #
' # # Written:march 27th 2000 #
' ###################################################
' ###################################################
' # # Include This file in your ASP script #
' # # Assign the Properties #
' # # Then use the Draw method #
' ###################################################
Class Barchart
Private Mchartbgcolor
Private Mcharttitle
Private Mchartwidth
Private Mchartvaluearray
Private Mchartlabelsarray
Private Mchartcolorarray
Private Mchartviewdatatype
Private Mchartbarheight
Private Mchartborder
Private Mcharttextcolor
Private Mchartcounter ' General counter
Private Mchartmaxvalue
Private Mchartfactor
Private mcharttotalvalues
Private Mchartminvalue
Public Property Let Chartbgcolor (Strcolor)
Mchartbgcolor = Strcolor
' Code validation
IF LEN (Mchartbgcolor) <> 7 THEN
Err. Number = vbObjectError + 1000
Err. Description = "Color string provided unequal to 7 characters"
Response.Write Err.Number & VbCRLF & ERR. Description
Err. Clear
EXIT Property
End IF
End Property
Public Property Let ChartTitle (Strtitle)
Mcharttitle = Strtitle
End Property
Public Property Let Chartwidth (Intwidth)
Mchartwidth = intwidth
End Property
Public Property Let Chartvaluearray (arrvalues)
Mchartvaluearray = arrvalues
IF not IsArray (Mchartvaluearray) THEN
Err. Number = vbObjectError + 1001
Err. Description = "Values passed are not an array"
Response.Write Err.Number & VbCRLF & ERR. Description
EXIT Property
Err. Clear
Err. Number = vbObjectError + 1002
Err. Description "Number of values passed does not match labels"
Response.Write Err.Number & VbCRLF & ERR. Description
Err. Clear
EXIT Property
End IF
End Property
Public Property Let Chartlabelsarray (Arrlabels)
Mchartlabelsarray = Arrlabels
IF not IsArray (Mchartlabelsarray) THEN
Err. Number = vbObjectError + 1001
Err. Description = "Label values passed are not an array"
Response.Write Err.Number & VbCRLF & ERR. Description
EXIT Property
&