*** set the LOCALEID to English nlLocaleId=sys(3004) && Save local id =sys(3006,1033) && We will be sending instructions in English * Part of xlChartType constants #Define xlBubble3DEffect 87 #Define xlColumnClustered 51 #Define xlBarClustered 57 #Define xlCategory 1 #Define TABULATE CHR(9) #Define CRLF CHR(13)+CHR(10) Select country,cnt(*) as 'Count' from customer group by country into cursor crsGraph Wait window nowait "Filling cell values..." MCGDATA = "" nCols = fcount() For ix = 1 to nCols MCGDATA = MCGDATA + iif(empty(MCGDATA),"",TABULATE)+field(ix) Endfor MCGDATA = MCGDATA + CRLF Scan For ix = 1 to nCols MCGDATA = MCGDATA + iif(ix=1,"",TABULATE)+nvl(transform(evaluate(field(ix))),"") Endfor MCGDATA = MCGDATA + CRLF Endscan * Data prepare * Create cursor testgen (graphtest g) Append blank Append general graphtest class MSGraph.Chart.5 data MCGDATA oForm = createobject("Form") With oForm .height = 450 .width = 650 .show .closable = .f. .addobject("myGraph","OleBoundControl") .addobject("myQuit1","myQuit") .addobject("myChanger1","myPlotChanger") With .myGraph .height = oForm.height - 20 .width = oForm.width .left = 0 .top = 20 .ControlSource = "testgen.graphtest" Wait window nowait "Plotting..." .ChartType=xlColumnClustered .object.application.plotby = 2 && Columns .haslegend = .F. *!* with .Legend.Font *!* .Bold = .f. *!* .Size = 8 *!* endwith With .Axes(xlCategory).TickLabels With .Font .Name = "Arial" .FontStyle = "Normal" .Size = 8 Endwith .Offset = 50 .Orientation = 90 Endwith .visible=.T. Endwith .myQuit1.visible = .t. .myChanger1.visible = .t. Endwith Wait clear **** Set the LocaleId to the previous value =sys(3006,val(nlLocaleId)) Read events Define class myquit as commandbutton Left=1 Top=0 AutoSize = .T. Caption="Close" Procedure click Release all Clear events Endproc Enddefine Define class myPlotChanger as commandbutton Left=150 Top=0 AutoSize = .T. Caption="Change plotby" Procedure click With thisform.myGraph.object.application .plotby = iif(.plotby=1,2,1) Endwith Endproc EnddefineCetin