myform.cntChart.ocxChart.footnote="My MSChart FootNote!"
*utChart.PRG (Terry) PUBLIC myform as Form, nChartType as Integer nChartType=0 myform=CREATEOBJECT('frmChartClass') myform.show DEFINE CLASS frmChartClass as form height=600 width=800 autocenter=.t. caption=[MSChart (RightClick to Change Type)* ]+PROGRAM() PROCEDURE release this.queryunload ENDPROC PROCEDURE init this.resize ENDPROC PROCEDURE QueryUnload CLEAR EVENTS RELEASE ALL ENDPROC PROCEDURE resize WITH this .cntChart.resize(.height,.width) ENDWITH ENDPROC ADD OBJECT cntChart as cntChartClass visible =.t. ENDDEFINE DEFINE CLASS cntChartClass as Container top = 0 left=0 backstyle=1 borderwidth=0 backstyle=0 PROCEDURE Init cntChartInit(this) ENDPROC PROCEDURE resize (nFormHeight,nFormWidth) WITH this .height=nFormHeight .width=nFormWidth .ocxChart.width=IIF(.Width>2,.width-2,2) .ocxChart.height=IIF(.Height>2,.Height-2,2) ENDWITH ENDPROC ADD OBJECT ocxChart as ocxChartClass ENDDEFINE define class ocxChartClass as Olecontrol OleClass="MSChart20Lib.MSChart.2" BorderStyle=1 top=1 left=1 PROCEDURE mouseup (button, shift, x, y) IF button=2 this.ChartType = nChartType nChartType=IIF(nChartType+1>9,0,nChartType+1) ENDIF visible=.f. enddef && class cntToolBar as Container PROCEDURE cntChartInit(oCnt) with oCnt.ocxChart .ChartType = 1 .COLUMNCOUNT = 8 .RowCount = 8 .Backdrop.Fill.Style= 1 && VtFillStyleBrush with .Backdrop.Fill.Brush.FillColor .red=255 .green=255 .blue=255 ENDWITH &&.Backdrop.Fill.Brush.FillColor *!* Populate the DataGrid Object. FOR lnCol = 1 TO 8 FOR lnRow = 1 TO 8 .COLUMN = lnCol .ROW = lnRow .DATA = lnRow * 10 NEXT ROW NEXT COLUMN .ShowLegend = .T. .visible=.t. ENDWITH &&oCnt.ocxChart ENDPROC * END utChart (terry)