//TH-Header //***************************************************************************************** // Copyright (c) 2022 Antwise Solutions // All rights reserved. // // $FileName : SyncFusion\AppSrc\csfWebChartAccumulationSeries.pkg // $ProjectName : SyncFusion Library // $Authors : Wil van Antwerpen // $Created : 2022-08-28 15:50 // // Contents: // This is used for loading the data that you can use in a csfWebAccumulationChart // // Documentation for the API is here: // https://ej2.syncfusion.com/documentation/api/accumulation-chart/accumulationSeriesModel/ // // //***************************************************************************************** //TH-RevisionStart // ******************** // MODIFICATION SUMMARY // ******************** // ####### DD/MM/YYYY WHO COMMENT //TH-RevisionEnd Use csfWebChartChild.pkg Use cJsonObject.pkg //Struct tSeriesDataSource //End_Struct Struct tsfWebChartSeriesDataLabel boolean visible End_Struct // https://ej2.syncfusion.com/documentation/api/accumulation-chart/accumulationSeriesModel/ Struct tsfWebChartAccumulationSeries tsfWebChartBorderModel border Boolean bEnableTooltip Integer iEndAngle Number nGapRatio String sGroupMode String sGroupTo Integer iHeight String sInnerRadius String sLegendImageUrl String sLegendShape String sName String sObjectId Number nOpacity String sPointColorMapping String sRadius String sSelectionStyle Integer iStartAngle String sTooltipMappingName String sType Boolean bVisible Integer iWidth String sXName String sYName tsfWebChartSeriesDataLabel dataLabel // tSeriesDataSource DataSource End_Struct { OverrideProperty=pbFillHeight Visibility=Private } Class csfWebChartAccumulationSeries Is a csfWebChartChild Procedure Construct_Object Forward Send Construct_Object Property String psObjectId "" // private, we need a way to link to the series at the js object // Options to customizing the border of the series. // { WebProperty=Client } Property String psBorderColor "" // Set the width in pixels. If the width is -1 (C_WebDefault) then it will // use the default. { WebProperty=Client } Property Integer piBorderWidth C_WebDefault // If set true, the Tooltip for series will be visible. // Default = true { WebProperty=Client } Property Boolean pbEnableTooltip True { WebProperty=Client } Property Integer piEndAngle C_WebDefault { WebProperty=Client } Property Number pnGapRatio C_WebDefault { WebProperty=Client } Property String psGroupMode "" { WebProperty=Client } Property String psGroupTo "" { WebProperty=Client } Property Integer piHeight C_WebDefault { WebProperty=Client } Property String psInnerRadius "" { WebProperty=Client } Property String psLegendImageUrl "" { EnumList="Circle, Rectangle, Triangle, Diamond, Cross, HorizontalLine, VerticalLine, Pentagon, InvertedTriangle, SeriesType, Image" } { InitialValue="SeriesType" } { WebProperty=Client } Property String psLegendShape "SeriesType" { WebProperty=Client } Property String psName "" // Set the opacity in a value between 0.0 and 1.0. If the width is -1 (C_WebDefault) then it will // use the default of 1.0 { WebProperty=Client } Property Number pnOpacity C_WebDefault { WebProperty=Client } Property String psPointColorMapping "" { WebProperty=Client } Property String psRadius "" { WebProperty=Client } Property String psSelectionStyle "" { WebProperty=Client } Property Integer piStartAngle C_WebDefault { WebProperty=Client } Property String psTooltipMappingName "" { EnumList="Line, Column, Area, Bar, Histogram, StackingColumn, StackingArea, StackingBar, StepLine, StepArea, Scatter, Spline, StackingColumn100, StackingBar100, StackingArea100, RangeColumn, Hilo, HiloOpenClose, Waterfall, RangeArea, SplineRangeArea, Bubble, Candle, Polar, Radar, BoxAndWhisker, Pareto" } { InitialValue="Line" } { WebProperty=Client } Property String psType "" { WebProperty=Client } Property Boolean pbVisible True { WebProperty=Client } Property Integer piWidth C_WebDefault { WebProperty=Client } Property String psXName "" { WebProperty=Client } Property String psYName "" // We set this to false, so we can detect if a DAW webcolumn was dropped // as it will have this set to true. Property Boolean pbIsWebColumn False // private { WebProperty=Client } Property Boolean pbDataLabelVisible False Property Handle phoJSONData // Set psJSClass To "sf.WebChartAccumulationSeries" End_Procedure Function LoadWebChartSeriesProperties Returns tsfWebChartAccumulationSeries String sXName String sYName String sXAxisName String sYAxisName tsfWebChartAccumulationSeries Series Get psObjectId To Series.sObjectId Get psBorderColor To Series.border.sColor Get piBorderWidth To Series.border.iWidth Get pbEnableTooltip To Series.bEnableTooltip Get piEndAngle To Series.iEndAngle Get pnGapRatio To Series.nGapRatio Get psGroupMode To Series.sGroupMode Get psGroupTo To Series.sGroupTo Get piHeight To Series.iHeight Get psInnerRadius To Series.sInnerRadius Get psLegendImageUrl To Series.sLegendImageUrl Get psLegendShape To Series.sLegendShape Get psName To Series.sName Get pnOpacity To Series.nOpacity Get psPointColorMapping To Series.sPointColorMapping Get psRadius To Series.sRadius Get psSelectionStyle To Series.sSelectionStyle Get piStartAngle To Series.iStartAngle Get psTooltipMappingName To Series.sTooltipMappingName Get psType To Series.sType Get pbVisible To Series.bVisible get piWidth To Series.iWidth Get psXName To sXName If (sXName="") Begin Move "x" To sXName // set a default if none is set Set psXName to sXName End Move sXName To Series.sXName Get psYName To sYName If (sYName="") Begin Move "y" To sYName Set psYName To sYName End Move sYName To Series.sYName Get pbDataLabelVisible To Series.dataLabel.visible Function_Return Series End_Function Procedure ConnectSeries String[] aParams Get psObjectId to aParams[0] Send ClientAction "connectSeries" aParams End_Procedure // Procedure LoadData String[] sData String[] aParams tWebValueTree tVT ValueTreeSerializeParameter sData to tVT Send ClientAction "loadData" aParams tVT End_Procedure Procedure AddPoint String sXValue String sYValue String sText Handle hoJSON Handle hoROW Integer iDecSep String sXName String sYName Get phoJSONData To hoJSON If (hoJSON) Begin Get Create (RefClass(cJsonObject)) to hoRow Send InitializeJsonType Of hoRow jsonTypeObject Get psXName To sXName Get psYName To sYName Get_Attribute DF_DECIMAL_SEPARATOR to iDecSep If (iDecSep=44) Begin // if is comma then... Move (Replace(',',sXValue,'.')) To sXValue Move (Replace(',',sYValue,'.')) To sYValue End Send SetMemberValue of hoRow sXName jsonTypeString sXValue Send SetMemberValue of hoRow sYName jsonTypeString sYValue If (num_arguments=3) Begin Send SetMemberValue of hoRow "text" jsonTypeString sText End Send AddMember of hoJSON hoRow Send Destroy Of hoRow End Else Begin Send UserError "No JSON Data Object has been created." "Developer error." End End_Procedure // empty event to use for creating your data series Procedure OnAddChartData End_Procedure Procedure LoadSeriesData Handle hoJSON String[] SeriesData Get Create (RefClass(cJsonObject)) to hoJSON If (hoJSON) Begin Send InitializeJsonType Of hoJSON jsonTypeArray Set phoJSONData To hoJSON Send OnAddChartData Get JsonDataToStringArray hoJSON to SeriesData Send LoadData SeriesData Set phoJSONData to 0 Send Destroy of hoJSON End End_Procedure Procedure End_Construct_Object Forward Send End_Construct_Object Delegate Send RegisterSeries Self End_Procedure End_Class