The price axis draging event
The price axis draging event
18 Feb 2021, 01:32
Hi,
please advise, what is the best event to manage the price axis streching and shrinking or at least moving a mouse over it.
The scrolling event seems not to be the best one as when it is made within the chart area the calculations are being done in real time but outside of it (when dragging the price axis), the calculation is delayed.
Thanks.
Replies
deknibar
18 Feb 2021, 14:30
Hi, yes it works well with zooming, but it does not handle moving of the price axis .
I have been using scrolling event to manage that, but it doesn't calculate constantly like mouse move but only at key points of moves which makes any objects jump instead of moving.
@deknibar
PanagiotisCharalampous
18 Feb 2021, 14:58
Hi deknibar,
Maybe you can describe what you are actually trying to do so that we can think of the best approach.
Best Regards,
Panagiotis
@PanagiotisCharalampous
deknibar
18 Feb 2021, 15:53
( Updated at: 19 Feb 2021, 00:45 )
Hi,
I have a control within the chart area which is assigned to the price.
When the chart area is being dragged, the control is following the price correctly. Its position is being calculated on mouse move in real time. When dragging is being made with the price axis with the scrolling event, the control is following the price by jumping to the price like it was calculated only on key points of the scrolling move.
I can't see any other event to handle the mouse move outside the chart area on each point of the move and I have seen an indicator that does that.
EDIT:
I have noticed that the chart area size changing event works the same way as the scrolling event.
@deknibar
PanagiotisCharalampous
19 Feb 2021, 07:53
Hi deknibar,
Could you share some source code so that we can see what are you looking at?
Best Regards,
Panagiotis
@PanagiotisCharalampous
deknibar
20 Feb 2021, 14:45
Hi,
I would like rather not to share my code. But the indicator that does that correctly is the one mentioned before:
https://ctrader.com/algos/indicators/show/2302
Placing of the controls is not important. No matter if dragging the chart area or the axis, the indicator works the same way. When I do it with the axis, it is not quite the same.
It is not that bad, but if is achievable it would look much better.
@deknibar
PanagiotisCharalampous
18 Feb 2021, 09:45
Hi deknibar,
Did you try the ZoomChanged event?
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous