Switching axes
-
- Newbie
- Posts: 36
- Joined: Wed Aug 24, 2016 12:00 am
Switching axes
Is it possible to switch the axes of chart so that x becomes y and vice versa without having to replot it as such - if so, how?
Re: Switching axes
Hello,
I'm not sure to understand what do you exactly want to achieve. Could you please expand? Some image can help to understand it.
I'm not sure to understand what do you exactly want to achieve. Could you please expand? Some image can help to understand it.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 36
- Joined: Wed Aug 24, 2016 12:00 am
Re: Switching axes
Basically the X and Y of a grid are oriented incorrectly.
X is currently on the left axis, Y on the bottom axis.
X should be on the bottom axis and Y on the left axis.
0 0 1 1
0 0 0 0
1 1 1 1
0 1 0 1
... should become...
1 0 1 1
1 0 1 0
0 0 1 1
0 0 1 0
so basically X is now on the bottom and inverted, y is on the left.
X is currently on the left axis, Y on the bottom axis.
X should be on the bottom axis and Y on the left axis.
0 0 1 1
0 0 0 0
1 1 1 1
0 1 0 1
... should become...
1 0 1 1
1 0 1 0
0 0 1 1
0 0 1 0
so basically X is now on the bottom and inverted, y is on the left.
Re: Switching axes
Hello,
You should manually manipulate the arrays in order to achieve this. You could use a temporal TColorGrid as follows:
You should manually manipulate the arrays in order to achieve this. You could use a temporal TColorGrid as follows:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var x, z: Integer;
begin
Series1.Marks.Visible:=true;
Series1.AddXYZ(0, 0, 0);
Series1.AddXYZ(1, 1, 0);
Series1.AddXYZ(2, 0, 0);
Series1.AddXYZ(3, 1, 0);
Series1.AddXYZ(0, 1, 1);
Series1.AddXYZ(1, 1, 1);
Series1.AddXYZ(2, 1, 1);
Series1.AddXYZ(3, 1, 1);
Series1.AddXYZ(0, 0, 2);
Series1.AddXYZ(1, 0, 2);
Series1.AddXYZ(2, 0, 2);
Series1.AddXYZ(3, 0, 2);
Series1.AddXYZ(0, 0, 3);
Series1.AddXYZ(1, 0, 3);
Series1.AddXYZ(2, 1, 3);
Series1.AddXYZ(3, 1, 3);
end;
procedure TForm1.Button1Click(Sender: TObject);
var tmpGrid: TColorGridSeries;
x, z: Integer;
begin
tmpGrid:=TColorGridSeries.Create(Self);
for x:=0 to Series1.NumXValues-1 do
for z:=0 to Series1.NumZValues-1 do
tmpGrid.AddXYZ((Series1.NumZValues-1)-z, Series1.YValue[(z*Series1.NumXValues)+x], x);
Series1.DataSource:=tmpGrid;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |