TeeChart FireMonkey (Windows,OSX,iOS & Android) for Embarcadero RAD Studio, Delphi and C++ Builder (XE5+)
-
cjacoby78
- Newbie
- Posts: 11
- Joined: Tue Mar 25, 2014 12:00 am
Post
by cjacoby78 » Fri Jun 27, 2014 8:14 pm
Hi all,
I am just doing my first tests with TeeChart in Appmethod 1.14 on the iOS platform. I have the TeeChart source code in my project group and everything compiles just fine.
My idea is to use TGanttSeries to represent an electronic program guide (tv guide) visually - my first tests are quite conclusive but panning/scrolling doesn't quite work correctly.
This is how I configured my TChart:
Code: Select all
fChart.LeftAxis.Automatic := false;
fChart.LeftAxis.Minimum := -0.5;
fChart.LeftAxis.Maximum := 5;
fChart.BottomAxis.Automatic := false;
fChart.BottomAxis.Minimum := 0;
fChart.BottomAxis.Maximum := 50;
fChart.AllowZoom := false;
fChart.Panning.Active := True;
fChart.AllowPanning := TPanningMode.pmBoth;
Panning works only once when the app is started and doesn't follow the finger but has an offset. A second attempt doesn't work anymore and the app needs to be restarted for the panning to work again.
Any ideas?
I am using the latest TeeChart 2014 source code for FireMonkey.
Thanks a lot!
CJ
-
Pep
- Site Admin
- Posts: 3306
- Joined: Fri Nov 14, 2003 5:00 am
-
Contact:
Post
by Pep » Tue Jul 01, 2014 10:42 am
Hello,
in order to make work the pan/scroll over the chart you have to add the following line of code to your code :
Code: Select all
fChart.ScrollMouseButton := TMouseButton.mbLeft;
-
cjacoby78
- Newbie
- Posts: 11
- Joined: Tue Mar 25, 2014 12:00 am
Post
by cjacoby78 » Tue Jul 01, 2014 5:56 pm
Thanks!
This is the solution!
One more question though - what's the recommended way to pan/scroll only inside some arbitrary bounds?
Regards,
Christian
-
cjacoby78
- Newbie
- Posts: 11
- Joined: Tue Mar 25, 2014 12:00 am
Post
by cjacoby78 » Tue Jul 01, 2014 8:56 pm
A way I succeeded in doing so, was implementing the onScroll event with this:
Code: Select all
if (fChart.BottomAxis.Minimum < 0) then
begin
fChart.BottomAxis.Minimum := 0;
fChart.BottomAxis.Maximum := fChart.BottomAxis.Minimum + 50;
end;
if (fChart.BottomAxis.Maximum > 70) then
begin
fChart.BottomAxis.Minimum := 20;
fChart.BottomAxis.Maximum := 70;
end;
which then blocks scrolling on the bottom axis to a boundary between 0 and 70.
-
Yeray
- Site Admin
- Posts: 9622
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
Post
by Yeray » Wed Jul 02, 2014 10:49 am
Hello,
cjacoby78 wrote:A way I succeeded in doing so, was implementing the onScroll event with this:
Code: Select all
if (fChart.BottomAxis.Minimum < 0) then
begin
fChart.BottomAxis.Minimum := 0;
fChart.BottomAxis.Maximum := fChart.BottomAxis.Minimum + 50;
end;
if (fChart.BottomAxis.Maximum > 70) then
begin
fChart.BottomAxis.Minimum := 20;
fChart.BottomAxis.Maximum := 70;
end;
which then blocks scrolling on the bottom axis to a boundary between 0 and 70.
Yes, onScroll event is the way to limit the scroll to a known area.
-
cjacoby78
- Newbie
- Posts: 11
- Joined: Tue Mar 25, 2014 12:00 am
Post
by cjacoby78 » Wed Jul 02, 2014 11:35 am
Thanks a lot!