Welcome Guest Search | Active Topics |

How to trap for the axis Zoom reset button click
Bob
#1 Posted : Sunday, March 30, 2014 12:25:52 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/21/2014(UTC)
Posts: 5

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Can I tell if the Reset Zoom button was selected?

I am using a chart with zoom enabled.
At render, I preset the actual zoom min and max as
axes: [

{
type: 'dateTime',
location: 'bottom',
zoomEnabled: true,
minimum: $scope.horizon.startDate,
maximum: $scope.horizon.endDate,
visibleMinimum: $scope.horizon.zoomStart,
visibleMaximum: $scope.horizon.zoomEnd
}

so the chart is automatically zoomed to a predetermined horizon

Now I need to code for these two events

1 ) If the reset zoom button was selected, I want to reset the visible min and max to match the initial state of the chart

2) If the user zooms all the way out using mouse I would not want to reset the zoom visible min and max
Dragan
#2 Posted : Monday, March 31, 2014 3:24:52 AM(UTC)
Rank: Advanced Member

Groups: Administrators, DataVizJavaScript, jQueryChart, jQueryDV, MvcChart, Registered
Joined: 1/3/2011(UTC)
Posts: 483

Thanks: 0 times
Was thanked: 87 time(s) in 87 post(s)
Here is how you can handle the click of the reset button:

Code:
$('#jqChart li').click(function (e) {

   var target = e.currentTarget;
   if (target.title == 'Reset Zoom (100%)') {
          // do comething
   }
});
Best Regards,
Dragan Matek
jqChart Inc.
Bob
#3 Posted : Monday, March 31, 2014 4:14:14 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/21/2014(UTC)
Posts: 5

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Thanks

My chart id is jqGantt and I tried this code but the click event did not fire

$('#jqGantt li').click(function (e) {

var target = e.currentTarget;
if (target.title == 'Reset Zoom (100%)') {
// do comething
}
});
Dragan
#4 Posted : Tuesday, April 01, 2014 6:09:27 AM(UTC)
Rank: Advanced Member

Groups: Administrators, DataVizJavaScript, jQueryChart, jQueryDV, MvcChart, Registered
Joined: 1/3/2011(UTC)
Posts: 483

Thanks: 0 times
Was thanked: 87 time(s) in 87 post(s)
I'm testing this and it seems to work. Can you send us ( support@jqchart.com ) your example, so we can take a look?
Best Regards,
Dragan Matek
jqChart Inc.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

FlatEarth Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.425 seconds.