Hello,
For bar series, the functions "AddXY" and "AddNullXY" do not insert, internally, the points in same order that column series. There is a sample attached.
I think that this is a BUG. Can anyone help me?
Thank you.
Alexandre da Silva.
Problem with bar series (THorizBarSeries)
Problem with bar series (THorizBarSeries)
- Attachments
-
- Unit1.rar
- (2.11 KiB) Downloaded 566 times
Re: Problem with bar series (THorizBarSeries)
Hello,
Sorting the values in your series helps on the majority of cases. However, note you should also have the same number of values in both series when using stacked.
Here a method you can call after adding your values that solves that problems:
Sorting the values in your series helps on the majority of cases. However, note you should also have the same number of values in both series when using stacked.
Here a method you can call after adding your values that solves that problems:
Code: Select all
procedure TForm1.FillAndSort;
procedure Sync(ASeries1, ASeries2: TChartSeries);
var i, j: Integer;
exists: Boolean;
begin
for i:=0 to ASeries1.Count-1 do
begin
exists:=False;
for j:=0 to ASeries2.Count-1 do
begin
if ASeries1.NotMandatoryValueList[i] = ASeries2.NotMandatoryValueList[j] then
begin
exists:=True;
break;
end;
end;
if not exists then
if ASeries1 is THorizBarSeries then
ASeries2.AddNullXY(0, ASeries1.YValue[i])
else
ASeries2.AddNullXY(ASeries1.XValue[i], 0);
end;
end;
begin
Sync(Chart1[0], Chart1[1]);
Sync(Chart1[1], Chart1[0]);
Sync(Chart2[0], Chart2[1]);
Sync(Chart2[1], Chart2[0]);
Chart1[0].XValues.Sort;
Chart1[1].XValues.Sort;
Chart2[0].YValues.Sort;
Chart2[1].YValues.Sort;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |