How to create a real smooth curve?
Posted: Tue Jul 11, 2017 12:01 pm
Hi,
I have the following simple code based on a chart with two line series:
The target is to get a smooth Series2 through the data points given by Series1.
But it does not look smooth at all: Without interpolation the curve is smooth but is does not go thru the points.
How to fix it?
BR
Uli
PS: using TSmoothingFunction leads to the same result
I have the following simple code based on a chart with two line series:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.BottomAxis.Logarithmic := true;
Chart1.BottomAxis.Automatic := false;
Chart1.BottomAxis.Maximum := 10000;
Chart1.BottomAxis.Minimum := 10;
Chart1.LeftAxis.Maximum := 6;
Chart1.LeftAxis.Minimum := -6;
Series1.Pointer.Visible := true;
Series2.DataSource := Series1;
Series2.Color := clRed;
Series1.Clear;
Series1.AddXY(10,2,'',clTeeColor);
Series1.AddXY(32,2,'',clTeeColor);
Series1.AddXY(600,2.5,'',clTeeColor);
Series1.AddXY(1000,0,'',clTeeColor);
Series1.AddXY(2000,-2,'',clTeeColor);
Series1.AddXY(8000,-1.5,'',clTeeColor);
Series1.AddXY(10000,-1.5,'',clTeeColor);
Series2.CheckDataSource;
Series2.Smoothed := true;
end;
But it does not look smooth at all: Without interpolation the curve is smooth but is does not go thru the points.
How to fix it?
BR
Uli
PS: using TSmoothingFunction leads to the same result