Use cWebView.pkg Use cWebPanel.pkg Use cWebForm.pkg Use csfWebChart.pkg Use cWebButton.pkg Use cWebDynamicObjectContainer.pkg Class csfDynWebChartSeries is a csfWebChartSeries Procedure Construct_Object Forward Send Construct_Object Property Integer pmsgAddMyData 0 End_Procedure Register_Procedure AddMyDataMsg Handle hoSeries Procedure OnAddChartData Integer addMyDataMsg Get pmsgAddMyData to addMyDataMsg If (addMyDataMsg<>0) Begin Send AddMyDataMsg Self End End_Procedure End_Class Object oDynamicLineChartDemo is a cWebView //Set piWidth to 700 Set psCaption to "Dynamic Object Line Chart Demo" // Your DDO structure will go here Object oWebMainPanel is a cWebPanel Set piColumnCount to 12 Set pbFillHeight to True Object oWebChart is a csfWebChart Set piHeight to 300 Set piColumnSpan to 0 Set psTitle to "Static line chart" Set pbTooltip to True Set piWidth to 800 Object oXAxis is a csfWebChartAxis Set peAxisType to chartAxisX Set psTitle to "X Axis" End_Object Object oYAxis is a csfWebChartAxis Set peAxisType to chartAxisY Set psTitle to "Y Axis" End_Object Object oFirstSeries is a csfWebChartSeries Object oFirstMarkers is a csfWebChartMarker Set pbVisible to True Object oFirstDataLabel is a csfWebChartDataLabel Set pbVisible to True Set psPosition to "Top" Set psAlignment to "Near" End_Object End_Object Procedure OnAddChartData Send AddPoint 1 2 Send AddPoint 2 3.6 Send AddPoint 3 7 Send AddPoint 4 6 End_Procedure End_Object Object oSecondSeries is a csfWebChartSeries Object oSecondMarkers is a csfWebChartMarker Set pbVisible to True Set psShape to "Diamond" Object oSecondDataLabel is a csfWebChartDataLabel Set pbVisible to True Set psPosition to "Bottom" Set psAlignment to "Far" End_Object End_Object Procedure OnAddChartData Send AddPoint 1 1 Send AddPoint 2 3 Send AddPoint 3 5 Send AddPoint 4 8 End_Procedure End_Object End_Object Object oWebDynamicChartContainer is a cWebDynamicObjectContainer Set piColumnCount to 12 Set pbFillHeight to True Procedure AddMyDataSeries Handle hoSeries Send AddPoint of hoSeries 1 2 Send AddPoint of hoSeries 2 3.6 Send AddPoint of hoSeries 3 7 Send AddPoint of hoSeries 4 6 End_Procedure Procedure CreateChart Handle hoChart hoSeriesOne Handle hoArea hoXAxis hoYAxis hoMarker hoDataLabel // Get CreateDynamicObject (RefClass(csfWebChart)) "oDynChart" "" to hoChart // Send InitDynamicProp of hoChart "piColumnSpan" 12 Send InitDynamicProp of hoChart "psTitle" "Dynamic Chart" Send InitDynamicProp of hoChart "piWidth" 1000 Send InitDynamicProp of hoChart "piHeight" 400 Get CreateDynamicObject (RefClass(csfWebChartAxis)) "oXAxis" "oDynChart" to hoXAxis Send InitDynamicProp of hoXAxis "peAxisType" chartAxisX Send InitDynamicProp of hoXAxis "psTitle" "X Axis" Send InitDynamicProp of hoXAxis "psValueType" "Category" Get CreateDynamicObject (RefClass(csfWebChartAxis)) "oYAxis" "oDynChart" to hoYAxis Send InitDynamicProp of hoYAxis "peAxisType" chartAxisY Send InitDynamicProp of hoYAxis "psTitle" "Sales" Send InitDynamicProp of hoYAxis "psLabelFormat" "{value}B" Get CreateDynamicObject (RefClass(csfWebChartArea)) "oArea" "oDynChart" to hoArea Send InitDynamicProp of hoArea "psBackground" "cornSilk" // Get CreateDynamicObject (RefClass(csfDynWebChartSeries)) "oSeriesOne" "oDynChart" to hoSeriesOne // Send InitDynamicProp of hoSeriesOne "psType" "Line" Send InitDynamicProp of hoSeriesOne "psType" "Column" Get CreateDynamicObject (RefClass(csfWebChartMarker)) "oMarkerOne" "oSeriesOne" to hoMarker Send InitDynamicProp of hoMarker "pbVisible" True Get CreateDynamicObject (RefClass(csfWebChartDataLabel)) "oDatalabelOne" "oMarkerOne" to hoDataLabel Send InitDynamicProp of hoDataLabel "pbVisible" True Send InitDynamicProp of hoDataLabel "psPosition" "Top" Send InitDynamicProp of hoDataLabel "psFill" "White" //Send InitDynamicProp of hoSeriesOne "psName" "Imports" // We have to reroute the OnAddData event somehow so we can add data... Set pmsgAddMyData of hoSeriesOne to msg_AddMyDataSeries // Send Activate Send ConfigureChartControl of hoChart End_Procedure End_Object Object oDynamicChartButton is a cWebButton Set piColumnSpan to 0 Set psCaption to "Add Dynamic Chart" Procedure OnClick Send CreateChart of oWebDynamicChartContainer End_Procedure End_Object End_Object End_Object