I need to creat a terrorseries with tpointseries, like what appears in this link: http://www.teechart.net/support/viewtopic.php?p=46388
In each 'X' will have some of error series, but they need to be drawn side by side for each XValue. I managed to put the error series, but how can i put the pointseries without overlap???
I found something like that: "Having a TErrorSeries with XValues 0, 1, 2,... the ErrorBars are drawn exactly in the X=0, X=1,... but when you have two TErrorSeries, they are drawn one next to the other so the first is drawn some pixels at the left side of X=0, X=1,... and the second TErrorSeries is drawn some pixels at the right side of X=0, X=1,... This is made to fit as many TErrorSeries as one would like to draw without overlapping. On the other hand, TPointSeries doesn't do this job. They don't prevent this overlapping. So, before proceeding with proposing you a workaround, we would need to know if you want your TErrorSeries to overlap or you want them to be drawn side by side for each XValue."
And I need drawn side by side, can someone help me?
I put the code like you suggested, but still continue the series overlapped on the X axis (I wanted the series stay side by side)
procedure TForm1.BtnGraphClick(Sender: TObject);
var
i, j : Integer;
Series1 : TErrorPointSeries;
x, y : Double;
Top, Bottom : Double;
max, min, k :array of array of integer;
ndecisor, ncri: integer;
begin
//Atribuindo valores na Matriz MAX, MIN, K
SetLength(Max, 3, 3);
max[0,0]:= 9;
max[0,1]:= 12;
max[0,2]:= 14;
max[1,0]:= 10;
max[1,1]:= 8;
max[1,2]:= 13;
max[2,0]:= 11;
max[2,1]:= 7;
max[2,2]:= 10;
SetLength(Min, 3, 3);
min[0,0]:= 2;
min[0,1]:= 0;
min[0,2]:= 3;
min[1,0]:= 3;
min[1,1]:= 1;
min[1,2]:= 4;
min[2,0]:= 1;
min[2,1]:= 2;
min[2,2]:= 0;
SetLength(k, 3, 3);
k[0,0]:= 5;
k[0,1]:= 8;
k[0,2]:= 4;
k[1,0]:= 7;
k[1,1]:= 5;
k[1,2]:= 6;
k[2,0]:= 6;
k[2,1]:= 7;
k[2,2]:= 5;
ndecisor:=3;
ncri:=3;
ErrorPointChart.View3D:=False;
ErrorPointChart.Axes.Left.MinimumOffset:=1;
ErrorPointChart.Axes.Left.MaximumOffset:=1;
for i := 0 to ndecisor -1 do
begin
Series1:=TErrorPointSeries.Create(ErrorPointChart);
Series1.Pen.Width:=3;
ErrorPointChart.AddSeries(Series1);
Randomize;
for j := 0 to ncri -1 do
begin
x:=j;
y:=k[j,i];;
Top:= max[j,i]-k[j,i];
Bottom:= k[j,i]-min[j,i];
Series1.Add(x,y,0,0,Top,Bottom);
end;
end;
end;