I want to change a chart dynamically. I was looking in the \samples\rmchart\dcchart.prg.
In region6, there is a sample with a BARGROUP and a LINEGROUP which is DcChartRegion oRegion6.
I want to change the chart, so the linegroup disappears. In the sample there is a button 'Apply new data'. This button has the following action:
Code: Select all
@ DCGUI_ROW, DCGUI_COL + 10 DCPUSHBUTTON CAPTION 'Apply New Data' SIZE 90,20 ;
TOOLTIP 'Apply new RANDOM data to all graph regions' ;
ACTION {||ApplyNewData1(oRMChart:regions[1]), ;
ApplyNewData2(oRMChart:regions[2]), ;
ApplyNewData4(oRMChart:regions[3]), ;
ApplyNewData4(oRMChart:regions[4]), ;
ApplyNewData6(oRMChart:regions[6]), ;
oRMChart:draw()}
Code: Select all
STATIC FUNCTION ApplyNewData6( oRegion , oChart )
Local aDataAxis
aDataAxis := oRegion:dataAxis // put the dataaxis array in a new array, it contains 2 elements, 1 for the bargroup, 1 for the linegroup
asize(aDataAxis,1)
oRegion:dataAxis := aDataAxis // contains now only one dataaxis, which is used by the BARGROUP
oRegion:lineGroup := nil // set linegroup array to nil
oRegion:haslinegroup := .f. // set to false, so it should not be drawn anymore
oRegion:reset()
RETURN nil
Am I missing something?