Page 1 of 1
Keep the chart in 2D view when moving or rotating.
Posted: Wed Jan 27, 2016 9:05 am
by 16576306
Hello,
When move or rotate a chart using TeeCommander, the original 2D chart becomes a 3D chart by itself. How to keep a chart in 2D view when it been moved or rotated?
Best regards,
Xiushan
Re: Keep the chart in 2D view when moving or rotating.
Posted: Wed Jan 27, 2016 9:07 am
by 16576306
Please find the attached files.
Re: Keep the chart in 2D view when moving or rotating.
Posted: Wed Jan 27, 2016 2:42 pm
by yeray
Hello,
That's a limitation on the rotation feature. It requires the chart to be in 3D to take effect.
Some alternatives I see:
- Set the Chart3DPercent to 0:
- Change your TLineSeries for TFastLineSeries.
Re: Keep the chart in 2D view when moving or rotating.
Posted: Thu Jan 28, 2016 1:25 am
by 16576306
Using TeeCommander to move, rotate or zoom, the chart properties (such as series color) change.
Re: Keep the chart in 2D view when moving or rotating.
Posted: Thu Jan 28, 2016 9:26 am
by yeray
Hello,
sripe wrote:Using TeeCommander to move, rotate or zoom, the chart properties (such as series color) change.
If you are using the first approach - using a TLineSeries with Chart3DPercent=0 - I'd suggest you to also set the series' LinePen.Color to be the series' Color. Ie:
Code: Select all
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.View3D:=false;
Chart1.Legend.Visible:=false;
Chart1.Chart3DPercent:=0;
with Chart1.AddSeries(TLineSeries) as TLineSeries do
begin
FillSampleValues;
LinePen.Color:=Color;
end;
end;
The second approach - using a TFastLineSeries instead of a TLineSeries - may make more sense in this case.
Re: Keep the chart in 2D view when moving or rotating.
Posted: Fri Jan 29, 2016 2:49 am
by 16576306
Using the first approach, and the FormCreate procedure as follows:
Code: Select all
procedure Tform1.FormCreate(Sender: TObject);
begin
with Chart1 do
begin
View3D := false;
View3DWalls := false;
Chart3DPercent := 0;
View3DOptions.Rotation := 0;
View3DOptions.Elevation := 360;
View3DOptions.Perspective := 0;
end;
end;
It works well with TLineSeries. But, using TeeCommander to move, rotate or zoom TPolarSeries, there are two problems:
1. When moving or zooming the chart, it inclines (tilts, leans) by itself. (see Fig1)
2. When rotating the chart, the selected series (there is a ChartListBox1 on the Form, and ChartListBox1.SelectedSeries is active) and the Chart rotate, but the other PolarSeries do not follow the rotating command. (see Fig2)
Re: Keep the chart in 2D view when moving or rotating.
Posted: Fri Jan 29, 2016 3:46 pm
by yeray
Hello,
sripe wrote:1. When moving or zooming the chart, it inclines (tilts, leans) by itself. (see Fig1)
I see it moving/zooming deactivates the 3D, but other than that I can move/zoom the chart around without problems:
- polarmoved.png (79.78 KiB) Viewed 13520 times
I've only placed a TChart and a TTeeCommander on a form and I use this code:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
with Chart1 do
begin
//View3D := false;
Chart3DPercent := 0;
Gradient.Visible:=false;
Title.Visible:=false;
Legend.Visible:=false;
end;
for i:=0 to 1 do
with Chart1.AddSeries(TPolarSeries) as TPolarSeries do
begin
FillSampleValues;
Pointer.Visible:=false;
Brush.Clear;
CircleBrush.Clear;
Pen.Color:=Color;
Pen.Width:=2;
end;
end;
sripe wrote:2. When rotating the chart, the selected series (there is a ChartListBox1 on the Form, and ChartListBox1.SelectedSeries is active) and the Chart rotate, but the other PolarSeries do not follow the rotating command. (see Fig2)
I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1423
Re: Keep the chart in 2D view when moving or rotating.
Posted: Sat Jan 30, 2016 1:36 am
by 16576306
Please press move or zoom button to test.
Re: Keep the chart in 2D view when moving or rotating.
Posted: Mon Feb 01, 2016 8:41 am
by yeray
Hello,
This is because when you start moving the chart it changes to 3D and the other properties (Elevation, Rotation, Orthogonal,...) take effect
Try setting Orthogonal to true or Elevation and Rotation to 360 after creating the series. Ie:
Code: Select all
with Chart1 do
begin
//Aspect.Orthogonal:=true;
Aspect.Elevation:=360;
Aspect.Rotation:=360;
end;
Re: Keep the chart in 2D view when moving or rotating.
Posted: Tue Feb 16, 2016 7:11 am
by 16576306
Using TPolarSeries, it seems that the four axes (RightAxis, LeftAxis, TopAxis and BottomAxis) do not intersect the same point at the center, although I use the following codes to make the chart show in 2D view.
with Chart1 do
begin
View3D := false;
View3DWalls := false;
Chart3DPercent := 0;
Aspect.Rotation := 360;
Aspect.Elevation := 360;
Aspect.Perspective := 0;
Gradient.Visible := true;
end;
How to make the four axes just right meet at the centre of a circle?
Re: Keep the chart in 2D view when moving or rotating.
Posted: Tue Feb 16, 2016 11:34 am
by yeray
Hello,
sripe wrote:Using TPolarSeries, it seems that the four axes (RightAxis, LeftAxis, TopAxis and BottomAxis) do not intersect the same point at the center, although I use the following codes to make the chart show in 2D view.
I see. I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1439