//TH-Header //***************************************************************************************** // Copyright (c) 2022 Antwise Solutions // All rights reserved. // // $FileName : SyncFusion\AppSrc\csfWebChartChild.pkg // $ProjectName : SyncFusion Library // $Authors : Wil van Antwerpen // $Created : 2022-08-26 15:50 // // Contents: // This is used as a base class for any of the child objects of cWebChart. // By doing that we can expose all the children in the Studio designer. // //***************************************************************************************** //TH-RevisionStart // ******************** // MODIFICATION SUMMARY // ******************** // ####### DD/MM/YYYY WHO COMMENT //TH-RevisionEnd Use cWebBaseControl.pkg Struct tsfWebChartBorderModel String sColor Integer iWidth End_Struct Struct tsfWebChartAnimation Integer iDelay Integer iDuration Boolean bEnable End_Struct { OverrideProperty=pbFillHeight Visibility=Private } { OverrideProperty=psLabel Visibility=Private } { OverrideProperty=psLabelColor Visibility=Private } { OverrideProperty=peLabelAlign Visibility=Private } { OverrideProperty=peLabelPosition Visibility=Private } { OverrideProperty=piLabelOffset Visibility=Private } { OverrideProperty=pbShowLabel Visibility=Private } { OverrideProperty=piColumnIndex Visibility=Private } { OverrideProperty=piColumnSpan Visibility=Private } { OverrideProperty=pbIsWebColumn Visibility=Private } { HelpTopic=cWebColumn } { DesignerJSClass=df.WebColumn } Class csfWebChartChild Is a cWebBaseControl Procedure Construct_Object Forward Send Construct_Object // 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 // Set psJSClass To "sf.WebChartChild" End_Procedure // This function breaks the json data up in a string array. // This circumvents the string array size for almost all cases as each array item // can take up to 64k. // Earlier on we did this via a simple UChar array, but we had problems with utf8 to oem // encoding issues and strangely it wasn't as performant either. Function JsonDataToStringArray Handle hoJSON Returns String[] Boolean bOK Integer iRow Integer iCount Handle hoRow String sRow String[] Data If (hoJSON<>0) Begin Get IsOfJsonType Of hoJson jsonTypeArray To bOK If (bOK) Begin Move '[ ' To Data[SizeOfArray(Data)] Get MemberCount Of hoJSON To iCount For iRow From 0 To (iCount-1) Get MemberByIndex Of hoJSON iRow To hoRow Get IsOfJsonType Of hoRow jsonTypeObject To bOK If (bOK) Begin Get Stringify Of hoRow To sRow If (iRow<(iCount-1)) Begin Move (sRow+", ") To sRow End Move sRow To Data[SizeOfArray(Data)] Send Destroy of hoRow End Loop Move " ]" To Data[SizeOfArray(Data)] End Else Begin Send UserError "The JSON data is not an array." End End Function_Return Data End_Function End_Class