Page 1 of 1

How to have independent Axis left and right

Posted: Thu Jun 18, 2020 1:07 pm
by 16588917
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?

Re: How to have independent Axis left and right

Posted: Tue Jun 23, 2020 8:04 am
by Marc
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

Re: How to have independent Axis left and right

Posted: Wed Jun 24, 2020 10:58 am
by 16588917
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?

Re: How to have independent Axis left and right

Posted: Wed Jun 24, 2020 8:13 pm
by 16588917
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.

Re: How to have independent Axis left and right

Posted: Thu Jun 25, 2020 6:49 am
by yeray
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.

Re: How to have independent Axis left and right

Posted: Thu Jun 25, 2020 2:24 pm
by 16588917
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

Re: How to have independent Axis left and right

Posted: Mon Jul 06, 2020 11:39 am
by yeray
Hello,

I've been trying to reproduce the problem without success. Video here:
https://youtu.be/ECjyYIeNi9E