HTML条形图函数库

80酷酷网    80kuku.com

  函数<%
' ###################################################
' ## 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
        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
     &

分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: