%
'------ Class Chart ------
Class Chart
Public strSQL
Public label2
Public numRecordsToShow
Public totalRecords
Public header
Public footer
Public strLabel
Public arrDataLabels
Public arrDataSeries
Public arrDataColor
Public arrFormatCurrency
Public arrFormatDecimal
Public arrFormatCustomer
Public arrFormatCustomerStr
Public arrDataSize
Public arrAxesColor
Public arrGaugeColor
Public arrOHLC_high
Public arrOHLC_low
Public arrOHLC_open
Public arrOHLC_close
Public arrOHLC_candle
Public arrOHLC_color
Public arrOHLC_color_up
Public arrOHLC_color_down
Public sleg
Public scol
Public chrt_array
Public webchart
Public cname
Public gstrOrderBy
Public table_type
Public sessionPrefix
Public Function init_Chart_p2(ByRef ch_array,ByVal param)
DoAssignmentByRef init_Chart_p2,method_Chart_Chart(me,ch_array,param)
End Function
Public Function setFooter_p1(ByVal name)
DoAssignmentByRef setFooter_p1,method_Chart_setFooter(me,name)
End Function
Public Function getFooter()
DoAssignmentByRef getFooter,method_Chart_getFooter(me)
End Function
Public Function setHeader_p1(ByVal name)
DoAssignmentByRef setHeader_p1,method_Chart_setHeader(me,name)
End Function
Public Function getHeader()
DoAssignmentByRef getHeader,method_Chart_getHeader(me)
End Function
Public Function setLabelField_p1(ByVal name)
DoAssignmentByRef setLabelField_p1,method_Chart_setLabelField(me,name)
End Function
Public Function getLabelField()
DoAssignmentByRef getLabelField,method_Chart_getLabelField(me)
End Function
Public Function setSeriaColor_p2(ByVal color,ByVal index)
DoAssignmentByRef setSeriaColor_p2,method_Chart_setSeriaColor(me,color,index)
End Function
Public Function getSeriaColor_p1(ByVal index)
DoAssignmentByRef getSeriaColor_p1,method_Chart_getSeriaColor(me,index)
End Function
Public Function setScrollingState_p1(ByVal scroll)
DoAssignmentByRef setScrollingState_p1,method_Chart_setScrollingState(me,scroll)
End Function
Public Function getScrollingState()
DoAssignmentByRef getScrollingState,method_Chart_getScrollingState(me)
End Function
Public Function setMaxBarScroll_p1(ByVal num)
DoAssignmentByRef setMaxBarScroll_p1,method_Chart_setMaxBarScroll(me,num)
End Function
Public Function getMaxBarScroll()
DoAssignmentByRef getMaxBarScroll,method_Chart_getMaxBarScroll(me)
End Function
Public Function write()
DoAssignmentByRef write,method_Chart_write(me)
End Function
Public Function write_legend()
DoAssignmentByRef write_legend,method_Chart_write_legend(me)
End Function
Public Function write_format()
DoAssignmentByRef write_format,method_Chart_write_format(me)
End Function
Public Function write_data()
DoAssignmentByRef write_data,method_Chart_write_data(me)
End Function
Public Function write_dps()
DoAssignmentByRef write_dps,method_Chart_write_dps(me)
End Function
Public Function write_chart_settings()
DoAssignmentByRef write_chart_settings,method_Chart_write_chart_settings(me)
End Function
Public Function formatCurrency_p2(ByVal val,ByVal series)
DoAssignmentByRef formatCurrency_p2,method_Chart_formatCurrency(me,val,series)
End Function
Public Function write_axes_custom()
DoAssignmentByRef write_axes_custom,method_Chart_write_axes_custom(me)
End Function
Public Function write_Logarithmic()
DoAssignmentByRef write_Logarithmic,method_Chart_write_Logarithmic(me)
End Function
Public Function write_Grid()
DoAssignmentByRef write_Grid,method_Chart_write_Grid(me)
End Function
Public Function write_extra()
DoAssignmentByRef write_extra,method_Chart_write_extra(me)
End Function
Public Function write_chart_background()
DoAssignmentByRef write_chart_background,method_Chart_write_chart_background(me)
End Function
Public Function color_series_p1(ByVal series)
DoAssignmentByRef color_series_p1,method_Chart_color_series(me,series)
End Function
Public Function labelFormat_p2(ByVal fieldName,ByVal data)
DoAssignmentByRef labelFormat_p2,method_Chart_labelFormat(me,fieldName,data)
End Function
Public Function getDefaultValue_p2(ByVal series,ByVal row)
DoAssignmentByRef getDefaultValue_p2,method_Chart_getDefaultValue(me,series,row)
End Function
Public Function valueFormat_p2(ByVal series,ByVal x_axis)
DoAssignmentByRef valueFormat_p2,method_Chart_valueFormat(me,series,x_axis)
End Function
Public Function valueFormat_p1(ByVal series)
DoAssignmentByRef valueFormat_p1,method_Chart_valueFormat(me,series,false)
End Function
Public Function tooltipFormat_p2(ByVal series,ByVal row)
DoAssignmentByRef tooltipFormat_p2,method_Chart_tooltipFormat(me,series,row)
End Function
Public Function get_data_p1(ByVal refr)
DoAssignmentByRef get_data_p1,method_Chart_get_data(me,refr)
End Function
Public Function chart_xmlencode_p1(ByVal str)
DoAssignmentByRef chart_xmlencode_p1,method_Chart_chart_xmlencode(me,str)
End Function
Public Function write_plot_background()
DoAssignmentByRef write_plot_background,method_Chart_write_plot_background(me)
End Function
' serialize stuff
Public Function ASPserialize
dim out
set out=CreateDictionary()
setArrElement out,"strSQL", strSQL
setArrElement out,"label2", label2
setArrElement out,"numRecordsToShow", numRecordsToShow
setArrElement out,"totalRecords", totalRecords
setArrElement out,"header", header
setArrElement out,"footer", footer
setArrElement out,"strLabel", strLabel
setArrElement out,"arrDataLabels", arrDataLabels
setArrElement out,"arrDataSeries", arrDataSeries
setArrElement out,"arrDataColor", arrDataColor
setArrElement out,"arrFormatCurrency", arrFormatCurrency
setArrElement out,"arrFormatDecimal", arrFormatDecimal
setArrElement out,"arrFormatCustomer", arrFormatCustomer
setArrElement out,"arrFormatCustomerStr", arrFormatCustomerStr
setArrElement out,"arrDataSize", arrDataSize
setArrElement out,"arrAxesColor", arrAxesColor
setArrElement out,"arrGaugeColor", arrGaugeColor
setArrElement out,"arrOHLC_high", arrOHLC_high
setArrElement out,"arrOHLC_low", arrOHLC_low
setArrElement out,"arrOHLC_open", arrOHLC_open
setArrElement out,"arrOHLC_close", arrOHLC_close
setArrElement out,"arrOHLC_candle", arrOHLC_candle
setArrElement out,"arrOHLC_color", arrOHLC_color
setArrElement out,"arrOHLC_color_up", arrOHLC_color_up
setArrElement out,"arrOHLC_color_down", arrOHLC_color_down
setArrElement out,"sleg", sleg
setArrElement out,"scol", scol
setArrElement out,"chrt_array", chrt_array
setArrElement out,"webchart", webchart
setArrElement out,"cname", cname
setArrElement out,"gstrOrderBy", gstrOrderBy
setArrElement out,"table_type", table_type
setArrElement out,"sessionPrefix", sessionPrefix
set ASPserialize = out
End Function
Public Sub ASPunserialize(dict)
DoAssignment strSQL, dict("strSQL")
DoAssignment label2, dict("label2")
DoAssignment numRecordsToShow, dict("numRecordsToShow")
DoAssignment totalRecords, dict("totalRecords")
DoAssignment header, dict("header")
DoAssignment footer, dict("footer")
DoAssignment strLabel, dict("strLabel")
DoAssignment arrDataLabels, dict("arrDataLabels")
DoAssignment arrDataSeries, dict("arrDataSeries")
DoAssignment arrDataColor, dict("arrDataColor")
DoAssignment arrFormatCurrency, dict("arrFormatCurrency")
DoAssignment arrFormatDecimal, dict("arrFormatDecimal")
DoAssignment arrFormatCustomer, dict("arrFormatCustomer")
DoAssignment arrFormatCustomerStr, dict("arrFormatCustomerStr")
DoAssignment arrDataSize, dict("arrDataSize")
DoAssignment arrAxesColor, dict("arrAxesColor")
DoAssignment arrGaugeColor, dict("arrGaugeColor")
DoAssignment arrOHLC_high, dict("arrOHLC_high")
DoAssignment arrOHLC_low, dict("arrOHLC_low")
DoAssignment arrOHLC_open, dict("arrOHLC_open")
DoAssignment arrOHLC_close, dict("arrOHLC_close")
DoAssignment arrOHLC_candle, dict("arrOHLC_candle")
DoAssignment arrOHLC_color, dict("arrOHLC_color")
DoAssignment arrOHLC_color_up, dict("arrOHLC_color_up")
DoAssignment arrOHLC_color_down, dict("arrOHLC_color_down")
DoAssignment sleg, dict("sleg")
DoAssignment scol, dict("scol")
DoAssignment chrt_array, dict("chrt_array")
DoAssignment webchart, dict("webchart")
DoAssignment cname, dict("cname")
DoAssignment gstrOrderBy, dict("gstrOrderBy")
DoAssignment table_type, dict("table_type")
DoAssignment sessionPrefix, dict("sessionPrefix")
End Sub
' end serialize
End Class
' Chart implementation
Function method_Chart_Chart(byref this_object,ByRef ch_array,ByVal param)
doClassAssignment this_object,"arrDataLabels",CreateDictionary()
doClassAssignment this_object,"arrDataSeries",CreateDictionary()
doClassAssignment this_object,"arrDataColor",CreateDictionary()
doClassAssignment this_object,"arrFormatCurrency",CreateDictionary()
doClassAssignment this_object,"arrFormatDecimal",CreateDictionary()
doClassAssignment this_object,"arrFormatCustomer",CreateDictionary()
doClassAssignment this_object,"arrFormatCustomerStr",CreateDictionary()
doClassAssignment this_object,"arrDataSize",CreateDictionary()
doClassAssignment this_object,"arrAxesColor",CreateDictionary()
doClassAssignment this_object,"arrGaugeColor",CreateDictionary()
doClassAssignment this_object,"arrOHLC_high",CreateDictionary()
doClassAssignment this_object,"arrOHLC_low",CreateDictionary()
doClassAssignment this_object,"arrOHLC_open",CreateDictionary()
doClassAssignment this_object,"arrOHLC_close",CreateDictionary()
doClassAssignment this_object,"arrOHLC_candle",CreateDictionary()
doClassAssignment this_object,"arrOHLC_color",CreateDictionary()
doClassAssignment this_object,"arrOHLC_color_up",CreateDictionary()
doClassAssignment this_object,"arrOHLC_color_down",CreateDictionary()
doClassAssignment this_object,"chrt_array",CreateDictionary()
this_object.sessionPrefix = ""
Dim TableName,i,k,beginColor,endColor,gColor,this,j,ind,gQuery,strWhereClause,searchHavingClause,var_SESSION,searchClauseObj,strOrderBy,strSQLbak,tstrSQL,eventObj,sql_query,pos
if bValue(this_object.webchart) then
doClassAssignment this_object,"chrt_array",Convert_Old_Chart(ch_array)
else
doClassAssignment this_object,"chrt_array",ch_array
end if
doClassAssignment this_object,"numRecordsToShow",ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"maxbarscroll")
if IsLess(this_object.numRecordsToShow,1) then
this_object.numRecordsToShow = 1
end if
doClassAssignment this_object,"table_type",ArrayElement(this_object.chrt_array,"table_type")
if not bValue(this_object.table_type) then
this_object.table_type = "project"
end if
doClassAssignment this_object,"webchart",ArrayElement(param,"webchart")
doClassAssignment this_object,"cname",ArrayElement(param,"cname")
doClassAssignment this_object,"sessionPrefix",ArrayElement(ArrayElement(this_object.chrt_array,"tables"),0)
doClassAssignment this_object,"gstrOrderBy",ArrayElement(param,"gstrOrderBy")
doAssignmentByRef TableName,GoodFieldName(ArrayElement(ArrayElement(this_object.chrt_array,"tables"),0))
doClassAssignment this_object,"header",ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"head")
doClassAssignment this_object,"footer",ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"foot")
i = 0
do while IsLess(i,CSmartDbl(asp_count(ArrayElement(this_object.chrt_array,"parameters")))-1)
if not IsEmpty(ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"currencyFormat")) then
setArrElement this_object.arrFormatCurrency,asp_count(this_object.arrFormatCurrency),ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"currencyFormat")
else
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"scur"),"false") then
setArrElement this_object.arrFormatCurrency,asp_count(this_object.arrFormatCurrency),""
else
setArrElement this_object.arrFormatCurrency,asp_count(this_object.arrFormatCurrency),ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"scur")
end if
end if
if not IsEmpty(ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"decimalFormat")) then
setArrElement this_object.arrFormatDecimal,asp_count(this_object.arrFormatDecimal),ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"decimalFormat")
else
setArrElement this_object.arrFormatDecimal,asp_count(this_object.arrFormatDecimal),ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"dec")
end if
setArrElement this_object.arrFormatCustomer,asp_count(this_object.arrFormatCustomer),ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"customFormat")
setArrElement this_object.arrFormatCustomerStr,asp_count(this_object.arrFormatCustomerStr),ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"customFormatStr")
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"ohlc") or IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"candlestick") then
setArrElement this_object.arrOHLC_open,asp_count(this_object.arrOHLC_open),ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"ohlcOpen")
setArrElement this_object.arrOHLC_high,asp_count(this_object.arrOHLC_high),ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"ohlcHigh")
setArrElement this_object.arrOHLC_low,asp_count(this_object.arrOHLC_low),ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"ohlcLow")
setArrElement this_object.arrOHLC_close,asp_count(this_object.arrOHLC_close),ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"ohlcClose")
setArrElement this_object.arrOHLC_color,asp_count(this_object.arrOHLC_color),"#" & CSmartStr(ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"ohlcColor"))
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"candlestick") then
setArrElement this_object.arrOHLC_candle,asp_count(this_object.arrOHLC_candle),"#" & CSmartStr(ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"ohlcCandleColor"))
end if
else
if not IsEqual(ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"name"),"") then
setArrElement this_object.arrDataSeries,asp_count(this_object.arrDataSeries),IIF(ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"agr_func"),ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"label"),ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"name"))
if not IsEmpty(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),("scolor" & CSmartStr(CSmartDbl(i)+1)) & "1")) then
setArrElement this_object.arrDataColor,asp_count(this_object.arrDataColor),ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),("scolor" & CSmartStr(CSmartDbl(i)+1)) & "1")
else
setArrElement this_object.arrDataColor,asp_count(this_object.arrDataColor),ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"series_color")
end if
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"bubble") then
setArrElement this_object.arrDataSize,asp_count(this_object.arrDataSize),ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"size")
end if
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"gauge") then
k = 0
do while bValue(asp_is_array(ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"gaugeColorZone"))) and IsLess(k,asp_count(ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"gaugeColorZone")))
beginColor = CSmartDbl(ArrayElement(ArrayElement(ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"gaugeColorZone"),k),"gaugeBeginColor"))
endColor = CSmartDbl(ArrayElement(ArrayElement(ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"gaugeColorZone"),k),"gaugeEndColor"))
gColor = "#" & CSmartStr(ArrayElement(ArrayElement(ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"gaugeColorZone"),k),"gaugeColor"))
setArrElementN this_object.arrGaugeColor,CreateArray2(CSmartDbl(asp_count(this_object.arrDataSeries))-1,empty),CreateDictionary3(Empty,beginColor,Empty,endColor,Empty,gColor)
k = CSmartDbl(k)+1
loop
end if
end if
end if
if IsEqual(this_object.table_type,"project") and not bValue(this_object.webchart) then
setArrElement this_object.arrDataLabels,asp_count(this_object.arrDataLabels),this_object.chart_xmlencode_p1(GetFieldLabel(GoodFieldName(TableName),GoodFieldName(ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"name"))))
else
if not bValue(this_object.chart_xmlencode_p1(ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"label"))) then
setArrElement this_object.arrDataLabels,asp_count(this_object.arrDataLabels),this_object.chart_xmlencode_p1(ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"name"))
else
setArrElement this_object.arrDataLabels,asp_count(this_object.arrDataLabels),this_object.chart_xmlencode_p1(ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),i),"label"))
end if
end if
i = CSmartDbl(i)+1
loop
if not IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"gauge") then
doClassAssignment this_object,"strLabel",ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),CSmartDbl(asp_count(ArrayElement(this_object.chrt_array,"parameters")))-1),"name")
j = 0
do while IsLess(j,asp_count(ArrayElement(this_object.chrt_array,"fields")))
if IsEqual(ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),CSmartDbl(asp_count(ArrayElement(this_object.chrt_array,"parameters")))-1),"name"),ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"fields"),j),"name")) then
if IsEqual(this_object.table_type,"project") then
doClassAssignment this_object,"label2",this_object.chart_xmlencode_p1(GetFieldLabel(TableName,GoodFieldName(ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),CSmartDbl(asp_count(ArrayElement(this_object.chrt_array,"parameters")))-1),"name"))))
else
doClassAssignment this_object,"label2",this_object.chart_xmlencode_p1(ArrayElement(ArrayElement(ArrayElement(this_object.chrt_array,"parameters"),CSmartDbl(asp_count(ArrayElement(this_object.chrt_array,"parameters")))-1),"name"))
end if
end if
j = CSmartDbl(j)+1
loop
end if
if not IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"ohlc") and not IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"candlestick") then
GetCollectionBounds this_object.arrDataColor,c_charts_loopIdx5,c_charts_loopMax5
do while c_charts_loopIdx5<=c_charts_loopMax5
ind = GetCollectionKey(this_object.arrDataColor,c_charts_loopIdx5)
doAssignment val,ArrayElement(this_object.arrDataColor,ind)
if IsEqual(ind,0) then
this_object.arrAxesColor = "#000000"
else
this_object.arrAxesColor = "#" & CSmartStr(ArrayElement(this_object.arrDataColor,ind))
end if
c_charts_loopIdx5=c_charts_loopIdx5+1
loop
else
GetCollectionBounds this_object.arrOHLC_color,c_charts_loopIdx6,c_charts_loopMax6
do while c_charts_loopIdx6<=c_charts_loopMax6
ind = GetCollectionKey(this_object.arrOHLC_color,c_charts_loopIdx6)
doAssignment val,ArrayElement(this_object.arrOHLC_color,ind)
if IsEqual(ind,0) then
this_object.arrAxesColor = "#000000"
else
this_object.arrAxesColor = "#" & CSmartStr(ArrayElement(this_object.arrOHLC_color,ind))
end if
c_charts_loopIdx6=c_charts_loopIdx6+1
loop
end if
doAssignmentByRef gQuery,GetTableData(this_object.sessionPrefix,".sqlquery",null)
strWhereClause = ""
searchHavingClause = ""
if not bValue(this_object.webchart) then
if not IsEmpty(Session(CSmartStr(this_object.sessionPrefix) & "_advsearch")) then
doAssignmentByRef searchClauseObj,unserialize(Session(CSmartStr(this_object.sessionPrefix) & "_advsearch"))
doAssignmentByRef strWhereClause,searchClauseObj.getWhere_p1(GetListOfFieldsByExprType(false,""))
doAssignmentByRef searchHavingClause,searchClauseObj.getWhere_p1(GetListOfFieldsByExprType(true,""))
end if
else
if not IsEqual(this_object.table_type,"project") then
strTableName = "webchart" & CSmartStr(this_object.cname)
else
doAssignment strTableName,TableName
end if
doAssignmentByRef strWhereClause,CalcSearchParam(not IsEqual(this_object.table_type,"project"))
end if
if bValue(strWhereClause) then
setArrElement this_object.chrt_array,"where",CSmartStr(ArrayElement(this_object.chrt_array,"where")) & CSmartStr(IIF(ArrayElement(this_object.chrt_array,"where"),(" AND (" & CSmartStr(strWhereClause)) & ")",(" WHERE (" & CSmartStr(strWhereClause)) & ")"))
end if
if IsEqual(this_object.table_type,"project") then
if bValue(SecuritySQL("Search","")) then
doAssignmentByRef strWhereClause,whereAdd(strWhereClause,SecuritySQL("Search",""))
end if
doClassAssignment this_object,"strSQL",gSQLWhere(strWhereClause,searchHavingClause)
doAssignment strOrderBy,this_object.gstrOrderBy
this_object.strSQL = CSmartStr(this_object.strSQL) & (" " & CSmartStr(strOrderBy))
doAssignment strSQLbak,this_object.strSQL
if bValue(tableEventExists("BeforeQueryChart",strTableName)) then
doAssignment tstrSQL,this_object.strSQL
doAssignmentByRef eventObj,getEventObject(strTableName)
eventObj.BeforeQueryChart_p3 tstrSQL,strWhereClause,strOrderBy
doClassAssignment this_object,"strSQL",tstrSQL
end if
if IsEqual(strSQLbak,this_object.strSQL) then
doClassAssignment this_object,"strSQL",gSQLWhere(strWhereClause,searchHavingClause)
this_object.strSQL = CSmartStr(this_object.strSQL) & (" " & CSmartStr(strOrderBy))
end if
end if
if bValue(this_object.cname) and IsEqual(this_object.table_type,"db") then
this_object.strSQL = ((CSmartStr(ArrayElement(this_object.chrt_array,"sql")) & CSmartStr(ArrayElement(this_object.chrt_array,"where"))) & CSmartStr(ArrayElement(this_object.chrt_array,"group_by"))) & CSmartStr(ArrayElement(this_object.chrt_array,"order_by"))
else
if bValue(this_object.cname) and IsEqual(this_object.table_type,"custom") then
if not bValue(IsStoredProcedure(ArrayElement(this_object.chrt_array,"sql"))) then
doAssignment sql_query,ArrayElement(this_object.chrt_array,"sql")
if IsEqual(GetDatabaseType(),2) then
doAssignmentByRef pos,asp_strrpos(asp_strtoupper(sql_query),"ORDER BY",empty)
if bValue(pos) then
doAssignmentByRef sql_query,asp_substr(sql_query,0,pos)
end if
end if
if not IsEqual(GetDatabaseType(),1) then
this_object.strSQL = (("select * from (" & CSmartStr(sql_query)) & ") as custom_query") & CSmartStr(ArrayElement(this_object.chrt_array,"where"))
else
this_object.strSQL = (("select * from (" & CSmartStr(sql_query)) & ")") & CSmartStr(ArrayElement(this_object.chrt_array,"where"))
end if
else
doClassAssignment this_object,"strSQL",ArrayElement(this_object.chrt_array,"sql")
end if
end if
end if
if bValue(tableEventExists("UpdateChartSettings",strTableName)) then
doAssignmentByRef eventObj,getEventObject(strTableName)
eventObj.UpdateChartSettings_p1 this_object
end if
End Function
Function method_Chart_setFooter(byref this_object,ByVal name)
doClassAssignment this_object,"footer",name
End Function
Function method_Chart_getFooter(byref this_object)
doAssignmentByRef method_Chart_getFooter,this_object.footer
Exit Function
End Function
Function method_Chart_setHeader(byref this_object,ByVal name)
doClassAssignment this_object,"header",name
End Function
Function method_Chart_getHeader(byref this_object)
doAssignmentByRef method_Chart_getHeader,this_object.header
Exit Function
End Function
Function method_Chart_setLabelField(byref this_object,ByVal name)
doClassAssignment this_object,"strLabel",name
End Function
Function method_Chart_getLabelField(byref this_object)
doAssignmentByRef method_Chart_getLabelField,this_object.strLabel
Exit Function
End Function
Function method_Chart_setSeriaColor(byref this_object,ByVal color,ByVal index)
setArrElement this_object.arrDataColor,index,color
End Function
Function method_Chart_getSeriaColor(byref this_object,ByVal index)
doAssignmentByRef method_Chart_getSeriaColor,ArrayElement(this_object.arrDataColor,index)
Exit Function
End Function
Function method_Chart_setScrollingState(byref this_object,ByVal scroll)
setArrElementN this_object.chrt_array,CreateArray2("appearance","cscroll"),scroll
End Function
Function method_Chart_getScrollingState(byref this_object)
method_Chart_getScrollingState = IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"cscroll"),"true")
Exit Function
End Function
Function method_Chart_setMaxBarScroll(byref this_object,ByVal num)
doClassAssignment this_object,"numRecordsToShow",num
End Function
Function method_Chart_getMaxBarScroll(byref this_object)
doAssignmentByRef method_Chart_getMaxBarScroll,this_object.numRecordsToShow
Exit Function
End Function
Function method_Chart_write(byref this_object)
Dim this
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"sanim"),"true") and not IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"autoupdate"),"true") then
ResponseWrite "" & vblf
else
ResponseWrite "" & vblf
end if
ResponseWrite "" & vblf
ResponseWrite "" & vblf
this_object.write_data
this_object.write_dps
this_object.write_chart_settings
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
End Function
Function method_Chart_write_legend(byref this_object)
Dim this
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"slegend"),"true") then
this_object.write_legend_tag
this_object.write_format
ResponseWrite "" & vblf
ResponseWrite "
" & vblf
ResponseWrite (("" & CSmartStr(this_object.footer)) & "") & vblf
ResponseWrite (("") & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite (("") & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
end if
End Function
Function method_Chart_write_format(byref this_object)
Dim this
if IsEqual(this_object.sleg,"Points") then
ResponseWrite (("{%Icon} {%Name} (" & CSmartStr(this_object.valueFormat_p1(0))) & ")") & vblf
end if
End Function
Function method_Chart_write_data(byref this_object)
End Function
Function method_Chart_write_dps(byref this_object)
End Function
Function method_Chart_write_chart_settings(byref this_object)
Dim this
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite (("" & CSmartStr(this_object.header)) & "") & vblf
ResponseWrite (("") & vblf
ResponseWrite "" & vblf
this_object.write_legend
this_object.write_axes
ResponseWrite "" & vblf
this_object.write_chart_background
ResponseWrite "" & vblf
this_object.write_plot_background
ResponseWrite "" & vblf
End Function
Function method_Chart_formatCurrency(byref this_object,ByVal val,ByVal series)
if bValue(ArrayElement(this_object.arrFormatCurrency,series)) then
do
If IsEqual(ArrayElement(locale_info,"LOCALE_ICURRENCY"),0) then
method_Chart_formatCurrency = CSmartStr(ArrayElement(locale_info,"LOCALE_SCURRENCY")) & CSmartStr(val)
Exit Function
End If
If IsEqual(ArrayElement(locale_info,"LOCALE_ICURRENCY"),0) or IsEqual(ArrayElement(locale_info,"LOCALE_ICURRENCY"),1) then
method_Chart_formatCurrency = CSmartStr(val) & CSmartStr(ArrayElement(locale_info,"LOCALE_SCURRENCY"))
Exit Function
End If
If IsEqual(ArrayElement(locale_info,"LOCALE_ICURRENCY"),0) or IsEqual(ArrayElement(locale_info,"LOCALE_ICURRENCY"),1) or IsEqual(ArrayElement(locale_info,"LOCALE_ICURRENCY"),2) then
method_Chart_formatCurrency = (CSmartStr(ArrayElement(locale_info,"LOCALE_SCURRENCY")) & " ") & CSmartStr(val)
Exit Function
End If
If IsEqual(ArrayElement(locale_info,"LOCALE_ICURRENCY"),0) or IsEqual(ArrayElement(locale_info,"LOCALE_ICURRENCY"),1) or IsEqual(ArrayElement(locale_info,"LOCALE_ICURRENCY"),2) or IsEqual(ArrayElement(locale_info,"LOCALE_ICURRENCY"),3) then
method_Chart_formatCurrency = (CSmartStr(val) & " ") & CSmartStr(ArrayElement(locale_info,"LOCALE_SCURRENCY"))
Exit Function
End If
Loop While false
end if
doAssignmentByRef method_Chart_formatCurrency,val
Exit Function
End Function
Function method_Chart_write_axes_custom(byref this_object)
Dim this,scroll
ResponseWrite "" & vblf
ResponseWrite "" & vblf
if not IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"saxes"),"true") then
ResponseWrite (("") & vblf
ResponseWrite (("") & vblf
ResponseWrite (("") & vblf
else
ResponseWrite (("") & vblf
ResponseWrite (("") & vblf
ResponseWrite (("") & vblf
end if
ResponseWrite "" & vblf
ResponseWrite (("" & CSmartStr(ArrayElement(this_object.arrDataLabels,0))) & "") & vblf
if not IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"saxes"),"true") then
ResponseWrite (("") & vblf
else
ResponseWrite (("") & vblf
end if
ResponseWrite "" & vblf
ResponseWrite (("") & vblf
ResponseWrite (("" & CSmartStr(this_object.valueFormat_p2(0,true))) & "") & vblf
if not IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"saxes"),"true") then
ResponseWrite (("") & vblf
else
ResponseWrite (("") & vblf
end if
ResponseWrite "" & vblf
ResponseWrite "" & vblf
this_object.write_Logarithmic
this_object.write_Stack
this_object.write_Grid
ResponseWrite "" & vblf
this_object.write_get_x_axis
ResponseWrite (("" & CSmartStr(this_object.label2)) & "") & vblf
ResponseWrite (("") & vblf
ResponseWrite "" & vblf
scroll = "false"
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"cscroll"),"true") and IsLess(this_object.numRecordsToShow,this_object.totalRecords) then
scroll = "true"
end if
ResponseWrite (((("") & vblf
ResponseWrite (("") & vblf
ResponseWrite (("") & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
this_object.write_extra
ResponseWrite "" & vblf
End Function
Function method_Chart_write_Logarithmic(byref this_object)
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"slog"),"true") then
ResponseWrite "" & vblf
end if
End Function
Function method_Chart_write_Grid(byref this_object)
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"sgrid"),"true") then
ResponseWrite "" & vblf
ResponseWrite (("") & vblf
ResponseWrite "" & vblf
ResponseWrite (("") & vblf
ResponseWrite (("") & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
end if
End Function
Function method_Chart_write_extra(byref this_object)
Dim i,position,this
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"saxes"),"true") then
ResponseWrite "" & vblf
i = 1
do while IsLess(i,asp_count(this_object.arrDataSeries))
doAssignment position,IIF(i mod 2=0,"Normal","Opposite")
ResponseWrite (((("") & vblf
ResponseWrite (("") & vblf
ResponseWrite (("") & vblf
ResponseWrite (("") & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite (("" & CSmartStr(ArrayElement(this_object.arrDataLabels,i))) & "") & vblf
ResponseWrite (("") & vblf
ResponseWrite "" & vblf
ResponseWrite (("") & vblf
ResponseWrite (("") & vblf
ResponseWrite (("" & CSmartStr(this_object.valueFormat_p2(i,true))) & "") & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
i = CSmartDbl(i)+1
loop
ResponseWrite "" & vblf
end if
End Function
Function method_Chart_write_chart_background(byref this_object)
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite (("") & vblf
if bValue(this_object.webchart) then
ResponseWrite (("") & vblf
else
ResponseWrite (("") & vblf
end if
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
ResponseWrite (("") & vblf
ResponseWrite (("") & vblf
ResponseWrite "" & vblf
ResponseWrite "" & vblf
End Function
Function method_Chart_color_series(byref this_object,ByVal series)
if IsLess(1,asp_count(this_object.arrDataSeries)) then
this_object.scol = ("color=""#" & CSmartStr(ArrayElement(this_object.arrDataColor,series))) & """"
this_object.sleg = "Series"
else
this_object.scol = "palette=""Default"""
this_object.sleg = "Points"
end if
End Function
Function method_Chart_labelFormat(byref this_object,ByVal fieldName,ByVal data)
Dim table,strViewFormat,strEditFormat,value,this
doAssignment table,this_object.sessionPrefix
doAssignmentByRef strViewFormat,GetFieldData(table,fieldName,"ViewFormat","")
doAssignmentByRef strEditFormat,GetFieldData(table,fieldName,"EditFormat","")
if ((IsEqual(strEditFormat,EDIT_FORMAT_LOOKUP_WIZARD) or IsEqual(strEditFormat,EDIT_FORMAT_RADIO)) and IsEqual(GetLookupType(fieldName,table),LT_LOOKUPTABLE)) and not IsEqual(GetLWLinkField(fieldName,table,true),GetLWDisplayField(fieldName,table,true)) then
doAssignmentByRef value,DisplayLookupWizard(fieldName,ArrayElement(data,fieldName),data,"",MODE_PRINT)
else
doAssignmentByRef value,GetData(data,fieldName,strViewFormat)
end if
if IsLess(50,asp_strlen(value)) then
value = CSmartStr(asp_substr(value,0,47)) & "..."
end if
doAssignmentByRef method_Chart_labelFormat,this_object.chart_xmlencode_p1(value)
Exit Function
End Function
Function method_Chart_getDefaultValue(byref this_object,ByVal series,ByVal row)
Dim res,this
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"ohlc") or IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"candlestick") then
res = ("O: " & CSmartStr(this_object.formatCurrency_p2(("{%Open}{numDecimals:" & CSmartStr(ArrayElement(this_object.arrFormatDecimal,series))) & "}",series))) & vbcr
res = CSmartStr(res) & (("H: " & CSmartStr(this_object.formatCurrency_p2(("{%High}{numDecimals:" & CSmartStr(ArrayElement(this_object.arrFormatDecimal,series))) & "}",series))) & vbcr)
res = CSmartStr(res) & (("L: " & CSmartStr(this_object.formatCurrency_p2(("{%Low}{numDecimals:" & CSmartStr(ArrayElement(this_object.arrFormatDecimal,series))) & "}",series))) & vbcr)
res = CSmartStr(res) & (("C: " & CSmartStr(this_object.formatCurrency_p2(("{%Close}{numDecimals:" & CSmartStr(ArrayElement(this_object.arrFormatDecimal,series))) & "}",series))) & vbcr)
else
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"bubble") then
res = "Series: {%SeriesName}" & vbcr
res = CSmartStr(res) & ((("Point Name: " & CSmartStr(this_object.labelFormat_p2(this_object.strLabel,row))) & "") & vbcr)
res = CSmartStr(res) & (("Value: " & CSmartStr(this_object.formatCurrency_p2(("{%Value}{numDecimals:" & CSmartStr(ArrayElement(this_object.arrFormatDecimal,series))) & "}",series))) & vbcr)
res = CSmartStr(res) & ("Bubble Size: {%BubbleSize}" & vbcr)
else
if ((IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"2d_bar") or IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"2d_column")) or IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"area")) or IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"funnel") then
res = (CSmartStr(this_object.labelFormat_p2(this_object.strLabel,row)) & " - ") & CSmartStr(this_object.formatCurrency_p2(("{%YValue}{numDecimals:" & CSmartStr(ArrayElement(this_object.arrFormatDecimal,series))) & "}",series))
else
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"line") or IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"combined") then
res = "Series: {%SeriesName}" & vbcr
res = CSmartStr(res) & (("Point Name: " & CSmartStr(this_object.labelFormat_p2(this_object.strLabel,row))) & vbcr)
res = CSmartStr(res) & (("Value: " & CSmartStr(this_object.formatCurrency_p2(("{%Value}{numDecimals:" & CSmartStr(ArrayElement(this_object.arrFormatDecimal,series))) & "}",series))) & vbcr)
else
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"2d_pie") or IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"2d_doughnut") then
res = ((CSmartStr(this_object.labelFormat_p2(this_object.strLabel,row)) & " - ") & CSmartStr(this_object.formatCurrency_p2(("{%YValue}{numDecimals:" & CSmartStr(ArrayElement(this_object.arrFormatDecimal,series))) & "}",series))) & vbcr
res = CSmartStr(res) & (("Percent: {%YPercentOfSeries}{numDecimals:" & CSmartStr(ArrayElement(this_object.arrFormatDecimal,series))) & "}%")
else
doAssignmentByRef res,this_object.formatCurrency_p2(("{%YValue}{numDecimals:" & CSmartStr(ArrayElement(this_object.arrFormatDecimal,series))) & "}",series)
end if
end if
end if
end if
end if
doAssignmentByRef method_Chart_getDefaultValue,res
Exit Function
End Function
Function method_Chart_valueFormat(byref this_object,ByVal series,ByVal x_axis)
Dim value,this
if not bValue(ArrayElement(this_object.arrFormatCustomer,series)) then
if bValue(x_axis) then
doAssignmentByRef value,this_object.formatCurrency_p2(("{%Value}{numDecimals:" & CSmartStr(ArrayElement(this_object.arrFormatDecimal,series))) & "}",series)
else
doAssignmentByRef value,this_object.formatCurrency_p2(("{%YValue}{numDecimals:" & CSmartStr(ArrayElement(this_object.arrFormatDecimal,series))) & "}",series)
end if
else
doAssignment value,ArrayElement(this_object.arrFormatCustomerStr,series)
end if
doAssignmentByRef method_Chart_valueFormat,value
Exit Function
End Function
Function method_Chart_tooltipFormat(byref this_object,ByVal series,ByVal row)
Dim value,this
if not bValue(ArrayElement(this_object.arrFormatCustomer,series)) then
doAssignmentByRef value,this_object.getDefaultValue_p2(series,row)
else
doAssignment value,ArrayElement(this_object.arrFormatCustomerStr,series)
end if
doAssignmentByRef method_Chart_tooltipFormat,value
Exit Function
End Function
Function method_Chart_get_data(byref this_object,ByVal refr)
Dim arrSer,i,this,rs,j,recPerRow,row
Set arrSer = (CreateDictionary())
i = 0
do while IsLess(i,asp_count(this_object.arrDataSeries))
this_object.color_series_p1 i
setArrElement arrSer,"series" & CSmartStr(i),(((((((("") & vblf
if (not IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"2d_pie") and not IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"2d_doughnut")) and not IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"chart_type"),"type"),"funnel") then
setArrElement arrSer,"series" & CSmartStr(i),CSmartStr(ArrayElement(arrSer,"series" & CSmartStr(i))) & ((((("") & vblf)
end if
i = CSmartDbl(i)+1
loop
doAssignmentByRef rs,db_query(this_object.strSQL,conn)
j = 0
doAssignment recPerRow,this_object.numRecordsToShow
do while bValue(doAssignmentByRef(row,db_fetch_array(rs)))
j = CSmartDbl(j)+1
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"cscroll"),"true") then
recPerRow = CSmartDbl(recPerRow)+1
end if
if IsLess(recPerRow,j) and IsLess(0,recPerRow) then
exit do
end if
i = 0
do while IsLess(i,asp_count(this_object.arrDataSeries))
setArrElement arrSer,"series" & CSmartStr(i),CSmartStr(ArrayElement(arrSer,"series" & CSmartStr(i))) & (CSmartStr(this_object.get_point_p2(i,row)) & vblf)
i = CSmartDbl(i)+1
loop
loop
doClassAssignment this_object,"totalRecords",j
i = 0
do while IsLess(i,asp_count(this_object.arrDataSeries))
if bValue(refr) then
ResponseWrite CSmartStr(ArrayElement(this_object.arrDataSeries,i)) & vblf
setArrElement arrSer,"series" & CSmartStr(i),asp_str_replace(CreateDictionary2(Empty,"\",Empty,vblf),CreateDictionary2(Empty,"\\",Empty,"\n"),ArrayElement(arrSer,"series" & CSmartStr(i)))
end if
if IsLess(0,j) then
ResponseWrite CSmartStr(ArrayElement(arrSer,"series" & CSmartStr(i))) & ""
end if
if not bValue(refr) or IsLess(i,CSmartDbl(asp_count(this_object.arrDataSeries))-1) then
ResponseWrite vblf
end if
i = CSmartDbl(i)+1
loop
db_close conn
End Function
Function method_Chart_chart_xmlencode(byref this_object,ByVal str)
doAssignmentByRef method_Chart_chart_xmlencode,asp_str_replace(CreateDictionary4(Empty,"&",Empty,"<",Empty,">",Empty,""""),CreateDictionary4(Empty,"&",Empty,"<",Empty,">",Empty,"""),str)
Exit Function
End Function
Function method_Chart_write_plot_background(byref this_object)
if not IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"color81"),"") then
ResponseWrite "" & vblf
if bValue(this_object.webchart) then
ResponseWrite (""
else
ResponseWrite "" & vblf
end if
ResponseWrite "" & vblf
end if
End Function
'------ Class Chart_Bar extends Chart ------
Class Chart_Bar
Public stacked
Public var_2d
Public bar
Public strSQL
Public label2
Public numRecordsToShow
Public totalRecords
Public header
Public footer
Public strLabel
Public arrDataLabels
Public arrDataSeries
Public arrDataColor
Public arrFormatCurrency
Public arrFormatDecimal
Public arrFormatCustomer
Public arrFormatCustomerStr
Public arrDataSize
Public arrAxesColor
Public arrGaugeColor
Public arrOHLC_high
Public arrOHLC_low
Public arrOHLC_open
Public arrOHLC_close
Public arrOHLC_candle
Public arrOHLC_color
Public arrOHLC_color_up
Public arrOHLC_color_down
Public sleg
Public scol
Public chrt_array
Public webchart
Public cname
Public gstrOrderBy
Public table_type
Public sessionPrefix
Public Function init_Chart_Bar_p2(ByRef ch_array,ByVal param)
DoAssignmentByRef init_Chart_Bar_p2,method_Chart_Bar_Chart_Bar(me,ch_array,param)
End Function
Public Function write_data()
DoAssignmentByRef write_data,method_Chart_Bar_write_data(me)
End Function
Public Function write_dps()
DoAssignmentByRef write_dps,method_Chart_Bar_write_dps(me)
End Function
Public Function write_get_x_axis()
DoAssignmentByRef write_get_x_axis,method_Chart_Bar_write_get_x_axis(me)
End Function
Public Function plot_type_name()
DoAssignmentByRef plot_type_name,method_Chart_Bar_plot_type_name(me)
End Function
Public Function series_3d_mode()
DoAssignmentByRef series_3d_mode,method_Chart_Bar_series_3d_mode(me)
End Function
Public Function chart_style_type()
DoAssignmentByRef chart_style_type,method_Chart_Bar_chart_style_type(me)
End Function
Public Function write_Stack()
DoAssignmentByRef write_Stack,method_Chart_Bar_write_Stack(me)
End Function
Public Function write_label_settings()
DoAssignmentByRef write_label_settings,method_Chart_Bar_write_label_settings(me)
End Function
Public Function get_point_p2(ByVal series,ByVal row)
DoAssignmentByRef get_point_p2,method_Chart_Bar_get_point(me,series,row)
End Function
Public Function write_axes()
DoAssignmentByRef write_axes,method_Chart_Bar_write_axes(me)
End Function
Public Function write_legend_tag()
DoAssignmentByRef write_legend_tag,method_Chart_Bar_write_legend_tag(me)
End Function
Public Function setFooter_p1(ByVal name)
DoAssignmentByRef setFooter_p1,method_Chart_setFooter(me,name)
End Function
Public Function getFooter()
DoAssignmentByRef getFooter,method_Chart_getFooter(me)
End Function
Public Function setHeader_p1(ByVal name)
DoAssignmentByRef setHeader_p1,method_Chart_setHeader(me,name)
End Function
Public Function getHeader()
DoAssignmentByRef getHeader,method_Chart_getHeader(me)
End Function
Public Function setLabelField_p1(ByVal name)
DoAssignmentByRef setLabelField_p1,method_Chart_setLabelField(me,name)
End Function
Public Function getLabelField()
DoAssignmentByRef getLabelField,method_Chart_getLabelField(me)
End Function
Public Function setSeriaColor_p2(ByVal color,ByVal index)
DoAssignmentByRef setSeriaColor_p2,method_Chart_setSeriaColor(me,color,index)
End Function
Public Function getSeriaColor_p1(ByVal index)
DoAssignmentByRef getSeriaColor_p1,method_Chart_getSeriaColor(me,index)
End Function
Public Function setScrollingState_p1(ByVal scroll)
DoAssignmentByRef setScrollingState_p1,method_Chart_setScrollingState(me,scroll)
End Function
Public Function getScrollingState()
DoAssignmentByRef getScrollingState,method_Chart_getScrollingState(me)
End Function
Public Function setMaxBarScroll_p1(ByVal num)
DoAssignmentByRef setMaxBarScroll_p1,method_Chart_setMaxBarScroll(me,num)
End Function
Public Function getMaxBarScroll()
DoAssignmentByRef getMaxBarScroll,method_Chart_getMaxBarScroll(me)
End Function
Public Function write()
DoAssignmentByRef write,method_Chart_write(me)
End Function
Public Function write_legend()
DoAssignmentByRef write_legend,method_Chart_write_legend(me)
End Function
Public Function write_format()
DoAssignmentByRef write_format,method_Chart_write_format(me)
End Function
Public Function write_chart_settings()
DoAssignmentByRef write_chart_settings,method_Chart_write_chart_settings(me)
End Function
Public Function formatCurrency_p2(ByVal val,ByVal series)
DoAssignmentByRef formatCurrency_p2,method_Chart_formatCurrency(me,val,series)
End Function
Public Function write_axes_custom()
DoAssignmentByRef write_axes_custom,method_Chart_write_axes_custom(me)
End Function
Public Function write_Logarithmic()
DoAssignmentByRef write_Logarithmic,method_Chart_write_Logarithmic(me)
End Function
Public Function write_Grid()
DoAssignmentByRef write_Grid,method_Chart_write_Grid(me)
End Function
Public Function write_extra()
DoAssignmentByRef write_extra,method_Chart_write_extra(me)
End Function
Public Function write_chart_background()
DoAssignmentByRef write_chart_background,method_Chart_write_chart_background(me)
End Function
Public Function color_series_p1(ByVal series)
DoAssignmentByRef color_series_p1,method_Chart_color_series(me,series)
End Function
Public Function labelFormat_p2(ByVal fieldName,ByVal data)
DoAssignmentByRef labelFormat_p2,method_Chart_labelFormat(me,fieldName,data)
End Function
Public Function getDefaultValue_p2(ByVal series,ByVal row)
DoAssignmentByRef getDefaultValue_p2,method_Chart_getDefaultValue(me,series,row)
End Function
Public Function valueFormat_p2(ByVal series,ByVal x_axis)
DoAssignmentByRef valueFormat_p2,method_Chart_valueFormat(me,series,x_axis)
End Function
Public Function valueFormat_p1(ByVal series)
DoAssignmentByRef valueFormat_p1,method_Chart_valueFormat(me,series,false)
End Function
Public Function tooltipFormat_p2(ByVal series,ByVal row)
DoAssignmentByRef tooltipFormat_p2,method_Chart_tooltipFormat(me,series,row)
End Function
Public Function get_data_p1(ByVal refr)
DoAssignmentByRef get_data_p1,method_Chart_get_data(me,refr)
End Function
Public Function chart_xmlencode_p1(ByVal str)
DoAssignmentByRef chart_xmlencode_p1,method_Chart_chart_xmlencode(me,str)
End Function
Public Function write_plot_background()
DoAssignmentByRef write_plot_background,method_Chart_write_plot_background(me)
End Function
' serialize stuff
Public Function ASPserialize
dim out
set out=CreateDictionary()
setArrElement out,"stacked", stacked
setArrElement out,"var_2d", var_2d
setArrElement out,"bar", bar
setArrElement out,"strSQL", strSQL
setArrElement out,"label2", label2
setArrElement out,"numRecordsToShow", numRecordsToShow
setArrElement out,"totalRecords", totalRecords
setArrElement out,"header", header
setArrElement out,"footer", footer
setArrElement out,"strLabel", strLabel
setArrElement out,"arrDataLabels", arrDataLabels
setArrElement out,"arrDataSeries", arrDataSeries
setArrElement out,"arrDataColor", arrDataColor
setArrElement out,"arrFormatCurrency", arrFormatCurrency
setArrElement out,"arrFormatDecimal", arrFormatDecimal
setArrElement out,"arrFormatCustomer", arrFormatCustomer
setArrElement out,"arrFormatCustomerStr", arrFormatCustomerStr
setArrElement out,"arrDataSize", arrDataSize
setArrElement out,"arrAxesColor", arrAxesColor
setArrElement out,"arrGaugeColor", arrGaugeColor
setArrElement out,"arrOHLC_high", arrOHLC_high
setArrElement out,"arrOHLC_low", arrOHLC_low
setArrElement out,"arrOHLC_open", arrOHLC_open
setArrElement out,"arrOHLC_close", arrOHLC_close
setArrElement out,"arrOHLC_candle", arrOHLC_candle
setArrElement out,"arrOHLC_color", arrOHLC_color
setArrElement out,"arrOHLC_color_up", arrOHLC_color_up
setArrElement out,"arrOHLC_color_down", arrOHLC_color_down
setArrElement out,"sleg", sleg
setArrElement out,"scol", scol
setArrElement out,"chrt_array", chrt_array
setArrElement out,"webchart", webchart
setArrElement out,"cname", cname
setArrElement out,"gstrOrderBy", gstrOrderBy
setArrElement out,"table_type", table_type
setArrElement out,"sessionPrefix", sessionPrefix
set ASPserialize = out
End Function
Public Sub ASPunserialize(dict)
DoAssignment stacked, dict("stacked")
DoAssignment var_2d, dict("var_2d")
DoAssignment bar, dict("bar")
DoAssignment strSQL, dict("strSQL")
DoAssignment label2, dict("label2")
DoAssignment numRecordsToShow, dict("numRecordsToShow")
DoAssignment totalRecords, dict("totalRecords")
DoAssignment header, dict("header")
DoAssignment footer, dict("footer")
DoAssignment strLabel, dict("strLabel")
DoAssignment arrDataLabels, dict("arrDataLabels")
DoAssignment arrDataSeries, dict("arrDataSeries")
DoAssignment arrDataColor, dict("arrDataColor")
DoAssignment arrFormatCurrency, dict("arrFormatCurrency")
DoAssignment arrFormatDecimal, dict("arrFormatDecimal")
DoAssignment arrFormatCustomer, dict("arrFormatCustomer")
DoAssignment arrFormatCustomerStr, dict("arrFormatCustomerStr")
DoAssignment arrDataSize, dict("arrDataSize")
DoAssignment arrAxesColor, dict("arrAxesColor")
DoAssignment arrGaugeColor, dict("arrGaugeColor")
DoAssignment arrOHLC_high, dict("arrOHLC_high")
DoAssignment arrOHLC_low, dict("arrOHLC_low")
DoAssignment arrOHLC_open, dict("arrOHLC_open")
DoAssignment arrOHLC_close, dict("arrOHLC_close")
DoAssignment arrOHLC_candle, dict("arrOHLC_candle")
DoAssignment arrOHLC_color, dict("arrOHLC_color")
DoAssignment arrOHLC_color_up, dict("arrOHLC_color_up")
DoAssignment arrOHLC_color_down, dict("arrOHLC_color_down")
DoAssignment sleg, dict("sleg")
DoAssignment scol, dict("scol")
DoAssignment chrt_array, dict("chrt_array")
DoAssignment webchart, dict("webchart")
DoAssignment cname, dict("cname")
DoAssignment gstrOrderBy, dict("gstrOrderBy")
DoAssignment table_type, dict("table_type")
DoAssignment sessionPrefix, dict("sessionPrefix")
End Sub
' end serialize
End Class
' Chart_Bar implementation
Function method_Chart_Bar_Chart_Bar(byref this_object,ByRef ch_array,ByVal param)
doClassAssignment this_object,"arrDataLabels",CreateDictionary()
doClassAssignment this_object,"arrDataSeries",CreateDictionary()
doClassAssignment this_object,"arrDataColor",CreateDictionary()
doClassAssignment this_object,"arrFormatCurrency",CreateDictionary()
doClassAssignment this_object,"arrFormatDecimal",CreateDictionary()
doClassAssignment this_object,"arrFormatCustomer",CreateDictionary()
doClassAssignment this_object,"arrFormatCustomerStr",CreateDictionary()
doClassAssignment this_object,"arrDataSize",CreateDictionary()
doClassAssignment this_object,"arrAxesColor",CreateDictionary()
doClassAssignment this_object,"arrGaugeColor",CreateDictionary()
doClassAssignment this_object,"arrOHLC_high",CreateDictionary()
doClassAssignment this_object,"arrOHLC_low",CreateDictionary()
doClassAssignment this_object,"arrOHLC_open",CreateDictionary()
doClassAssignment this_object,"arrOHLC_close",CreateDictionary()
doClassAssignment this_object,"arrOHLC_candle",CreateDictionary()
doClassAssignment this_object,"arrOHLC_color",CreateDictionary()
doClassAssignment this_object,"arrOHLC_color_up",CreateDictionary()
doClassAssignment this_object,"arrOHLC_color_down",CreateDictionary()
doClassAssignment this_object,"chrt_array",CreateDictionary()
this_object.sessionPrefix = ""
doClassAssignment this_object,"stacked",ArrayElement(param,"stacked")
doClassAssignment this_object,"var_2d",ArrayElement(param,"2d")
doClassAssignment this_object,"bar",ArrayElement(param,"bar")
method_Chart_Chart this_object,ch_array,param
End Function
Function method_Chart_Bar_write_data(byref this_object)
Dim this
ResponseWrite (("") & vblf
ResponseWrite "" & vblf
this_object.get_data_p1 false
ResponseWrite "" & vblf
End Function
Function method_Chart_Bar_write_dps(byref this_object)
Dim this
ResponseWrite (("") & vblf
ResponseWrite (("") & vblf
ResponseWrite this_object.write_label_settings()
ResponseWrite "" & vblf
ResponseWrite "" & vblf
End Function
Function method_Chart_Bar_write_get_x_axis(byref this_object)
ResponseWrite "" & vblf
ResponseWrite (("") & vblf
ResponseWrite (("") & vblf
ResponseWrite (("") & vblf
ResponseWrite "" & vblf
End Function
Function method_Chart_Bar_plot_type_name(byref this_object)
if not bValue(this_object.bar) then
method_Chart_Bar_plot_type_name = "CategorizedVertical"
Exit Function
else
method_Chart_Bar_plot_type_name = "CategorizedHorizontal"
Exit Function
end if
End Function
Function method_Chart_Bar_series_3d_mode(byref this_object)
Dim str
str = ""
if not bValue(this_object.var_2d) then
str = " enable_3d_mode=""True"""
if bValue(this_object.bar) then
str = CSmartStr(str) & " z_aspect=""1.1"""
end if
end if
doAssignmentByRef method_Chart_Bar_series_3d_mode,str
Exit Function
End Function
Function method_Chart_Bar_chart_style_type(byref this_object)
Dim str
str = ""
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"aqua"),1) then
str = " style=""AquaLight"""
else
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"aqua"),2) then
str = " style=""AquaDark"""
end if
end if
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"cview"),1) then
str = CSmartStr(str) & " shape_type=""Cone"""
else
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"cview"),2) then
str = CSmartStr(str) & " shape_type=""Cylinder"""
else
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"cview"),3) then
str = CSmartStr(str) & " shape_type=""Pyramid"""
end if
end if
end if
doAssignmentByRef method_Chart_Bar_chart_style_type,str
Exit Function
End Function
Function method_Chart_Bar_write_Stack(byref this_object)
if bValue(this_object.stacked) then
if IsEqual(ArrayElement(ArrayElement(this_object.chrt_array,"appearance"),"sstacked"),"true") then
ResponseWrite "" & vblf
else
ResponseWrite "" & vblf
end if
end if
End Function
Function method_Chart_Bar_write_label_settings(byref this_object)
Dim rotation,position,effect,str
rotation = ""
position = ""
effect = ""
if bValue(this_object.stacked) then
rotation = " rotation=""0"""
position = ""
effect = "" & vblf
effect = CSmartStr(effect) & ("" & vblf)
effect = CSmartStr(effect) & ("" & vblf)
effect = CSmartStr(effect) & ("" & vblf)
effect = CSmartStr(effect) & ("" & vblf)
effect = CSmartStr(effect) & ("" & vblf)
end if
str = (((("") & vblf
str = CSmartStr(str) & (CSmartStr(position) & vblf)
str = CSmartStr(str) & (CSmartStr(effect) & vblf)
str = CSmartStr(str) & ("" & vblf)
doAssignmentByRef method_Chart_Bar_write_label_settings,str
Exit Function
End Function
Function method_Chart_Bar_get_point(byref this_object,ByVal series,ByVal row)
Dim strLabelFormat,this,str
doAssignmentByRef strLabelFormat,this_object.labelFormat_p2(this_object.strLabel,row)
str = (((((""
str = CSmartStr(str) & ((("" & CSmartStr(this_object.tooltipFormat_p2(series,row))) & "") & vblf)
str = CSmartStr(str) & ("" & vblf)
doAssignmentByRef method_Chart_Bar_get_point,str
Exit Function
End Function
Function method_Chart_Bar_write_axes(byref this_object)
Dim this
this_object.write_axes_custom
End Function
Function method_Chart_Bar_write_legend_tag(byref this_object)
Dim posit,padd,hgt,align
posit = ""
padd = ""
hgt = ""
align = ""
if (bValue(this_object.var_2d) and not bValue(this_object.bar)) and not bValue(this_object.stacked) then
posit = "Bottom"
align = "align=""Spread"""
padd = "padding=""15"""
hgt = "height=""20%"""
else
posit = "Right"
end if
ResponseWrite (((((((("