//TH-Header //***************************************************************************************** // Copyright (c) 2024 Antwise Solutions // All rights reserved. // // $FileName : SyncFusion\AppSrc\csfWebChartBase.pkg // $ProjectName : SyncFusion Library // $Authors : Wil van Antwerpen // $Created : 2024-06-06 // // Contents: // This is a base class for the web framework wrapper class for the // SyncFusion Chart control and SyncFusion accumulation chart control. // //***************************************************************************************** //TH-RevisionStart // ******************** // MODIFICATION SUMMARY // ******************** // ####### DD/MM/YYYY WHO COMMENT //TH-RevisionEnd Use csfWebBaseControl.pkg Use csfWebChartArea.pkg Use csfWebChartTooltip.pkg // C Web Chart Export Type Enumeration_List Define cwcet_JPEG For 0 Define cwcet_PNG For 1 Define cwcet_SVG For 2 Define cwcet_PDF For 3 Define cwcet_XLSX For 4 Define cwcet_CSV For 5 End_Enumeration_List { OverrideProperty=pSeriesHandles Visibility=Private } { OverrideProperty=phoChartArea Visibility=Private } { OverrideProperty=phoChartTooltip Visibility=Private } { DesignerClass=cDTCWebGrid } { DesignerJSClass=df.WebList } { CompositeClass=csfWebChartChild } Class csfWebChartBase is a csfWebBaseControl Procedure Construct_Object Forward Send Construct_Object // The Chart title. { WebProperty=Client } Property String psTitle "" // ** deprecated - use cfsWebChartTooltip object instead ** // If enabled show a tooltip on the data point // { WebProperty=Client } Property Boolean pbTooltip False // // To enable export feature in chart. // Defaults to true // { WebProperty=Client } Property Boolean pbEnableExport True // ** deprecated - use csfWebChartTooltip object instead ** // If tooltips are enabled, then you can add a header for that tooltip. // { WebProperty=Client } Property String psTooltipHeader "" // If set then it determines the width of the Chart. If equal to 0 then it uses the width as // automatically determined. { WebProperty=Client } Property Integer piWidth 0 // enable/disable onCreated event { WebProperty=Client } Property Boolean pbServerOnCreated False // Private properties used for configuring the chart control. Property Handle phoChartArea Property Handle phoChartTooltip Set piHeight To 350 End_Procedure { Visibility=Private } Procedure RegisterArea Handle hoArea If (hoArea<>0) Begin Set phoChartArea to hoArea End End_Procedure { Visibility=Private } Function LoadAreaPrototype Returns tsfWebChartArea Handle hoArea tsfWebChartArea Area Get phoChartArea to hoArea If (hoArea<>0) Begin Get LoadWebChartAreaProperties Of hoArea To Area End Function_Return Area End_Function { Visibility=Private } Procedure RegisterTooltip Handle hoTooltip If (hoTooltip<>0) Begin Set phoChartTooltip to hoTooltip End End_Procedure { Visibility=Private } Function LoadTooltipPrototype Returns tsfWebChartTooltip Handle hoTooltip tsfWebChartTooltip Tooltip Get phoChartTooltip to hoTooltip If (hoTooltip<>0) Begin Get LoadWebChartTooltipProperties Of hoTooltip To Tooltip End Function_Return Tooltip End_Function Procedure Clear String[] sData Send ClientAction "unloadChart" End_Procedure // // Runs the chart's export feature // Procedure ExportChart Integer eFileType String sFileName String sFileType String[] asParams tWebValueTree tVT Move (ResizeArray(asParams,2)) To asParams Move "JPEG" To sFileType Case Begin Case (eFileType=cwcet_JPEG) Move "JPEG" To sFileType Case Break Case (eFileType=cwcet_PNG) Move "PNG" To sFileType Case Break Case (eFileType=cwcet_SVG) Move "SVG" To sFileType Case Break Case (eFileType=cwcet_PDF) Move "PDF" To sFileType Case Break Case (eFileType=cwcet_XLSX) Move "XLSX" To sFileType Case Break Case (eFileType=cwcet_CSV) Move "CSV" To sFileType Case Break Case End Move sFileType To asParams[0] Move sFileName To asParams[1] Send ClientAction "exportChart" asParams tVT End_Procedure // // Applies all the pending property changes and renders the component again // Procedure RefreshChart Send ClientAction "refreshChart" End_Procedure // Hook that can be used to load data or to do any post configure grid // actions. Procedure onPostConfigureChart End_Procedure { Visibility=Private } Procedure ConnectChartArea Handle hoArea Get phoChartArea to hoArea If (hoArea) Begin Send ConnectArea Of hoArea End End_Procedure { Visibility=Private } Procedure ConnectChartTooltip Handle hoTooltip Get phoChartTooltip to hoTooltip If (hoTooltip) Begin Send ConnectTooltip Of hoTooltip End End_Procedure { Visibility=Private } Procedure doPostConfigureChart // Send ConnectChartSeries Send ConnectChartArea Send ConnectChartTooltip Send OnPostConfigureChart End_Procedure Procedure doRenderChart Send OnRender Send ClientAction "renderChart" End_Procedure // // Executes before we ask the grid to render itself. // This is a good hook for calling your RestoreLayout logic. // Procedure OnRender End_Procedure // Triggers when the component in the browser is created. (needs to be enabled) { MethodType=Event } Procedure OnCreated End_Procedure Procedure End_Construct_Object WebPublishProcedure ConfigureChartControl WebPublishProcedure OnCreated Forward Send End_Construct_Object End_Procedure End_Class