日期:2012-05-04  浏览次数:20888 次

<%
' ###################################################
' ## BarChart                                       #
' ## Class to draw bar charts in ASP applications   #
' ## Author : Anton Bawab                           #
' ## First 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