Hello
Is it possible to force TAxisScrollTool to obey axis settings like pTChartAxis->ExactDateTime = true; pTChartAxis->Increment = DateTimeStep[dtFifteenMinutes];
I would try to do this but I can't find any event in TAxisScrollTool that would be proper for such functionality.
Any help appreciated.
Best Regards,
Grzegorz
TAxisScrollTool event to correct scroll
Re: TAxisScrollTool event to correct scroll
Hello,
The TChart OnScroll event is fired when you drag the mouse over an axis (having a TAxisScrollTool).
The TChart OnScroll event is fired when you drag the mouse over an axis (having a TAxisScrollTool).
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TAxisScrollTool event to correct scroll
Hello
I try to correct axis min and max from OnAllowScroll but there is probably a bug in TAxisScrollTool because it doesn't consider values than was changed inside that event.
There is also small bug that TAxisScrollTool call OnAllowScroll event with "Axis" variable instead of "AAxis".
Best Regards,
Grzegorz
I try to correct axis min and max from OnAllowScroll but there is probably a bug in TAxisScrollTool because it doesn't consider values than was changed inside that event.
There is also small bug that TAxisScrollTool call OnAllowScroll event with "Axis" variable instead of "AAxis".
Code: Select all
if Assigned(TCustomChart(ParentChart).OnAllowScroll) then
begin
tmpMin:=AAxis.Minimum+ADelta;
tmpMax:=AAxis.Maximum+ADelta;
TCustomChart(ParentChart).OnAllowScroll(Axis,tmpMin,tmpMax,tmp);
end;
Grzegorz
Re: TAxisScrollTool event to correct scroll
Hello Grzegorz,
OnAllowScroll event was thought to give the option to cancel the scroll action "on the fly", not to change the axis scale. To change the axis scale you should use OnScroll event.
OnAllowScroll event was thought to give the option to cancel the scroll action "on the fly", not to change the axis scale. To change the axis scale you should use OnScroll event.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TAxisScrollTool event to correct scroll
Hello,
I try to use OnScroll but I need information which axis was scrolled. Can you tell me how to do this please?
Best Regards,
Grzegorz
I try to use OnScroll but I need information which axis was scrolled. Can you tell me how to do this please?
Best Regards,
Grzegorz
Re: TAxisScrollTool event to correct scroll
Hello Grzegorz,
The problem I see is that when OnScroll event is fired, several axes could have been scrolled. At OnAllowScroll you could add "Sender" into an array of TChartAxis and check that array at OnScroll event (and clear it).
The problem I see is that when OnScroll event is fired, several axes could have been scrolled. At OnAllowScroll you could add "Sender" into an array of TChartAxis and check that array at OnScroll event (and clear it).
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TAxisScrollTool event to correct scroll
Hello
I've had similar idea but the bug mentioned above doesn't let me to do this.
TAxisScrollTool call OnAllowScroll event with "Axis" variable instead of "AAxis". That's why I get NULL if none axis is selected or pointer to axis chosen in TAxisScrollTool settings instead of axis that do the real scroll.
This problem is also linked to bug http://bugs.teechart.net/show_bug.cgi?id=1651
Is there any time frame for resolving bugs that I reported ?
Best Regards,
Grzegorz
I've had similar idea but the bug mentioned above doesn't let me to do this.
TAxisScrollTool call OnAllowScroll event with "Axis" variable instead of "AAxis". That's why I get NULL if none axis is selected or pointer to axis chosen in TAxisScrollTool settings instead of axis that do the real scroll.
This problem is also linked to bug http://bugs.teechart.net/show_bug.cgi?id=1651
Is there any time frame for resolving bugs that I reported ?
Best Regards,
Grzegorz
Re: TAxisScrollTool event to correct scroll
Hello Grzegorz,
The next maintenance release will include this small modification.
In your case, you could play with the OnMouseDown/OnMouseUp events to determine whether the scroll started over an axis. Ie:
I'm sorry. I applied the fix you suggested above before testing the OnAllowScroll event, and that's why it worked for me.Technicon wrote:I've had similar idea but the bug mentioned above doesn't let me to do this.
TAxisScrollTool call OnAllowScroll event with "Axis" variable instead of "AAxis". That's why I get NULL if none axis is selected or pointer to axis chosen in TAxisScrollTool settings instead of axis that do the real scroll.
The next maintenance release will include this small modification.
In your case, you could play with the OnMouseDown/OnMouseUp events to determine whether the scroll started over an axis. Ie:
Code: Select all
var onAxis: TChartAxis;
procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var i: Integer;
begin
onAxis:=nil;
for i:=0 to Chart1.Axes.Count-1 do
if Chart1.Axes.Items[i].Clicked(X,Y) then
begin
onAxis:=Chart1.Axes.Items[i];
Exit;
end;
end;
procedure TForm1.Chart1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
onAxis:=nil;
end;
procedure TForm1.Chart1Scroll(Sender: TObject);
begin
if Assigned(onAxis) then
// adjust min and max as you wish
end;
As you can see the ticket is "In progress". I have a fix in the works waiting for a second verification.Technicon wrote:This problem is also linked to bug http://bugs.teechart.net/show_bug.cgi?id=1651
I'm afraid we can't say when the tickets will be closed. See the Bug Fixing PolicyTechnicon wrote:Is there any time frame for resolving bugs that I reported ?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |