From: "Alfred ten Hoeve" Subject: Re: X-Y Graphs using Teechart Date: 03 May 1999 00:00:00 GMT Message-ID: <925690927.615576@polka> Cache-Post-Path: polka!unknown@9.136.dialin.mxs.nl References: <372BC258.11A13002@ibm.net> X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 X-Complaints-To: newsmaster@admin.big-orange.net X-Trace: rumba.admin.big-orange.net 925690927 31032 172.22.0.80 (3 May 1999 00:22:07 GMT) Organization: MultiAccess NNTP-Posting-Date: 3 May 1999 00:22:07 GMT Newsgroups: comp.lang.pascal.delphi.misc Robert Till heeft geschreven in bericht <372BC258.11A13002@ibm.net>... >I'm wondering how to plot an X-Y graph using the Teechart that came with >delphi 4. > >The demo says to add lines on FormCreate like this: > >Series1.Add( 25 , 'Rome', clTeeColor) >Series1.Add( 50 , 'New York , clTeeColor) >etc... > >This puts the cities on the X axis and the numbers on the Y axis. > >I just want to graph numbers on the Y axis vs. numbers on the X axis. > >How do I add numbers to the series to do this? > >Thanks, > >Bob > Robert (or Bob) here is an example: procedure TForm1.Button2Click(Sender: TObject); var x, y : Double; begin x := -2; repeat y := x * x; Chart1.Series[0].AddXY(x, y, '', clRed); Chart1.Series[1].AddXY(x, x, '', clBlue); x := x + 0.01; until x > 2; end; this prints the line y = x and the parabola y = x*x. Hope it helps you, Alfred.