Hi,
I try to manage custom axis on a screen. To prepare free space for axis I had to detect if it's visible on the screen. I know that axis should have visible property set to true and It should have active series attache to.
But there is one situation that I can't figure out. When eg. I have 3 series each one is connected to another axis, then I deactivate series one by one the axis from last deactivated series stays visible (when there is no active series).
How to check if custom axis is really visible?
Best Regards,
Grzegorz
How to check if custom axis is visible
Re: How to check if custom axis is visible
Hello Grzegorz,
I've tried to reproduce the problem with the simple example below but it seems to work fine for me here.
I'm adding several series, each one with its custom vertical axis. I'm hiding the walls and all the axes except the bottom axis and the custom vertical axes. Then, I've added a checkbox that deactivates/activates all the series, the custom vertical axes and the bottom axis:
I've tried to reproduce the problem with the simple example below but it seems to work fine for me here.
I'm adding several series, each one with its custom vertical axis. I'm hiding the walls and all the axes except the bottom axis and the custom vertical axes. Then, I've added a checkbox that deactivates/activates all the series, the custom vertical axes and the bottom axis:
Code: Select all
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
tmpAxis: TChartAxis;
begin
Chart1.Legend.Visible:=false;
Chart1.View3D:=false;
CheckBox1.Checked:=true;
for i:=0 to Chart1.AxesList.Count-1 do
if Chart1.Axes[i]<>Chart1.Axes.Bottom then
Chart1.Axes[i].Visible:=false;
for i:=0 to 3 do
begin
tmpAxis:=Chart1.CustomAxes.Add;
tmpAxis.Horizontal:=false;
with Chart1.AddSeries(TFastLineSeries) as TFastLineSeries do
begin
FillSampleValues;
CustomVertAxis:=tmpAxis;
end;
end;
Chart1.Walls.Visible:=false;
Chart1.MarginLeft:=10;
end;
procedure TForm1.CheckBox1Click(Sender: TObject);
var i: Integer;
begin
for i:=0 to Chart1.SeriesCount-1 do
begin
Chart1[i].Active:=CheckBox1.Checked;
Chart1[i].CustomVertAxis.Visible:=Chart1[i].Active;
end;
Chart1.Axes.Bottom.Visible:=CheckBox1.Checked;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: How to check if custom axis is visible
Hello
Ok now I see what I'm doing wrong. When custom axis doesn't have active series attached are hidden, but when there is no active series on a chart all axis are visible, but I didn't notice this because they all have the same position and they overlap each other.
Best Regards,
Grzegorz
Ok now I see what I'm doing wrong. When custom axis doesn't have active series attached are hidden, but when there is no active series on a chart all axis are visible, but I didn't notice this because they all have the same position and they overlap each other.
Best Regards,
Grzegorz