Single Custom Left Axes Does not behave the same as LeftAxis

TeeChart FireMonkey (Windows,OSX,iOS & Android) for Embarcadero RAD Studio, Delphi and C++ Builder (XE5+)
Post Reply
wjgroup
Newbie
Newbie
Posts: 2
Joined: Wed Jan 04, 2017 12:00 am

Single Custom Left Axes Does not behave the same as LeftAxis

Post by wjgroup » Sat Nov 25, 2017 12:41 am

TeeChartPro v2017.22.170619 32Bit FMX
I have a requirement for multiple left axis with associated series with the user able to select which Axis and Series are to be shown.
To do this I implemented multiple Custom Axis with their associated series.
The problem is that if only custom axes are being displayed then I am unable to adjust or even under default conditions (LabelSize and TitleSize set to 0) get all the left axis labels and titles to show.
I have reduced this issue to
1. Create new project
2. Add TChart
3. Add the following code to be called from the forms constructor.

Code: Select all

procedure TfrmPondLevelTest.SetupChart;
var
  newSeries: TLineSeries;
  customAxis: TChartAxis;
begin
  Chart.ClearChart;
  Chart.View3D         := False;
  Chart.Legend.Visible := False;

  // Create new series
  newSeries := TLineSeries.Create(Chart);
  Chart.AddSeries(newSeries);
  newSeries.Title            := 'SERIES TITLE';

  if False then
  begin
    // Series uses left axis
    Chart.LeftAxis.Title.Caption := 'LEFT AXIS';
    Chart.LeftAxis.LabelsSize    := 25;
    Chart.LeftAxis.TitleSize     := 25;
  end;

  if True then
  begin
    // Series uses Custom Axis
    customAxis               := TChartAxis.Create(Chart.CustomAxes);
    customAxis.Title.Caption := 'CUSTOM AXIS';
    newSeries.CustomVertAxis := customAxis;
    customAxis.LabelsSize    := 25;
    customAxis.TitleSize     := 25;
  end;

  newSeries.FillSampleValues(20);
end;
If I use the LeftAxis if then code then I get the following
LeftAxis.png
LeftAxis.png (14.03 KiB) Viewed 14437 times
If I use the CustomAxis if then code then I get the following
CustomAxis.png
CustomAxis.png (11.07 KiB) Viewed 14436 times
The only difference in the above is which axes is being used, Left or Custom.
I would expect to get the same result in both cases but I am not and I cannot figure out how to get the custom axis to behave the same as the Left Axis.
Any help would be appreciated.

Yeray
Site Admin
Site Admin
Posts: 9622
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Single Custom Left Axes Does not behave the same as LeftAxis

Post by Yeray » Mon Nov 27, 2017 9:05 am

Hello,

Try adding some margins:

Code: Select all

  Chart1.MarginLeft:=60;
  Chart1.MarginRight:=20;
  Chart1.MarginBottom:=10;
  Chart1.MarginTop:=10;
  Chart1.MarginUnits:=muPixels;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

wjgroup
Newbie
Newbie
Posts: 2
Joined: Wed Jan 04, 2017 12:00 am

Re: Single Custom Left Axes Does not behave the same as LeftAxis

Post by wjgroup » Tue Nov 28, 2017 5:48 pm

Thought I had tried the margins. That does solve the problem for the Custom Axes and will work for my case.
However If I use the same code with the Left axis I get the Chart moved over by the margin entered as Expected of a margin.
Therefore if I happen to be mixing axes (Left and Custom) I would need to be aware of this and decide whether or not to add the margin.
I would expect both Custom and Left to work the same.

Yeray
Site Admin
Site Admin
Posts: 9622
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Single Custom Left Axes Does not behave the same as LeftAxis

Post by Yeray » Wed Nov 29, 2017 1:02 pm

Hello,

Your request sounds similar to #126.
Feel free to add your mail to the CC list to be notified when an update arrives.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply