How to have independent Axis left and right

TeeChart FireMonkey (Windows,OSX,iOS & Android) for Embarcadero RAD Studio, Delphi and C++ Builder (XE5+)
Post Reply
Roland
Newbie
Newbie
Posts: 4
Joined: Mon Jun 15, 2020 12:00 am

How to have independent Axis left and right

Post by Roland » Thu Jun 18, 2020 1:07 pm

Hi,
1. I want to have a candlestick series and a volume series in the same chart.
No problem - I can achieve that. Candlestick assigned to left axis and volume to right axis.
2. I want to set the min and max of the candlesticks axis when I zoom in to the visible candles plus some delta for the beauty, at the same time I want to leave my Volume axis (the right axis) to start from 0 and end at max(volume) * 4 (as you do in your example).
I can achieve the setting of min max for the candlestick series axis, but the problem with this is, that at the same time always the Volume Axis (the right axis) is also changed, so that it does not start at 0 and ends not at max(volume) * 4 . This is still happening even though I set all Automatic properties to false.

What can I do about that? Is there any property I am missing to have the axes independent of each other or do I somehow need to do it with a custom axis for the Volumes?

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: How to have independent Axis left and right

Post by Marc » Tue Jun 23, 2020 8:04 am

Hello,

One way to achieve that would be to set the Right Axis scale in the OnZoom event.

ie.

Code: Select all

procedure TForm14.Chart1Zoom(Sender: TObject);
begin
  Chart1.Axes.Right.SetMinMax(0,volumSeries.MaxYValue * 4);
end;
Regards,
Marc Meumann
Steema Support

Roland
Newbie
Newbie
Posts: 4
Joined: Mon Jun 15, 2020 12:00 am

Re: How to have independent Axis left and right

Post by Roland » Wed Jun 24, 2020 10:58 am

Hi Marc,
thanks a lot. That works for the right axis.
I have still another problem, the FirstDisplayedIndex should give me the index of the first series point visible, but in my case when zooming the chart it gives me always 0. Shouldn't that FirstDisplayedIndex be working for Zoomed charts also? What could I have misconfigured?

Roland
Newbie
Newbie
Posts: 4
Joined: Mon Jun 15, 2020 12:00 am

Re: How to have independent Axis left and right

Post by Roland » Wed Jun 24, 2020 8:13 pm

I figured out, that it is not working because the line ...
if CalcVisiblePoints and (NotMandatoryValueList.Order<>loNone) then
... in FMXTee.Engine CalcFirstLastVisibleIndex is false in my situation.

No idea why this is the case, when I change the order of the series it is working.

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

Re: How to have independent Axis left and right

Post by Yeray » Thu Jun 25, 2020 6:49 am

Hello,

We'll be pleased to take a look at it if you can arrange a simple example project we can run as-is to reproduce the problem here.
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

Roland
Newbie
Newbie
Posts: 4
Joined: Mon Jun 15, 2020 12:00 am

Re: How to have independent Axis left and right

Post by Roland » Thu Jun 25, 2020 2:24 pm

Hi Yeray,
it is working if I change the series DateValues.Order to some value other than loNone.

The bug is that adding a tool to the chart in the Chart Designer switches the DateValues.Order to loNone again.

Which of course can be fixed again by changing the loNone value again to loAscending or loDescending.

See Screen Capture here ... https://www.youtube.com/watch?v=EQqod9bfXPI

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

Re: How to have independent Axis left and right

Post by Yeray » Mon Jul 06, 2020 11:39 am

Hello,

I've been trying to reproduce the problem without success. Video here:
https://youtu.be/ECjyYIeNi9E
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