Page 1 of 1

Scatter Chart

Posted: Fri Jun 02, 2006 2:28 pm
by 8443014
How can I produce a scatter chart with lines joining successive points in the order they are input, as for example in MS EXCEL'S XY (Scatter) chart type.

Thanks Nick

Posted: Fri Jun 02, 2006 2:40 pm
by narcis
Hi Nick,

You can use a TLineSeries and make its pointer visible:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=false;
  Series1.FillSampleValues();
  Series1.Pointer.Visible:=true;
  Series1.Pointer.Style:=psDiamond;
end;

Scatter Chart

Posted: Fri Jun 02, 2006 3:01 pm
by 9231184
Hi Narcis,

Will this chart in the order the data is input rather than in ascending x-axis order?

Thanks NickH

Posted: Fri Jun 02, 2006 3:24 pm
by narcis
Hi NickH,

Then you may better use a TPoint3DSeries and something like this:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=false;
  With Series1 do
  begin
    AddXY(8,7);
    AddXY(1,4);
    AddXY(2,5);
    AddXY(7,3);
    AddXY(6,2);
    AddXY(5,7);
    AddXY(9,1);
    Pointer.Style:=psDiamond;
    Pen.Color:=Color;
  end;
end;