Jump to content
Software FX Community

Zoom and Scroll Event


thrashard

Recommended Posts

How do I capture the Zoom and Scroll events?  I need to update other charts and grids based on the area zoomed into.

 I tried ScrollViewChanged, but this did not seem to catch anything but the initial zoom in.  I need to know when the zoom or scroll changes and more specifically what the new date range selected is.

 

Thanks.

Link to comment
Share on other sites

We are in the process of building a sample to confirm that the API covers your scenario and post it here, note that GetScrollView should return the range as doubles, if you are using Dates you can translate those values using the static methods in DataUnit (e.g. DoubleToDate)

JuanC

Link to comment
Share on other sites

We have uploaded a new build 3807 that should fix the issue where the second time you zoom the ScrollViewChanged is not fired. I tested both zoom stripe and map and rezooming and scrolling sent the event as expected. If you have any problems with this build please try posting/sending a sample app that reproduces the issues.

JuanC

Link to comment
Share on other sites

Carlos,

Thanks a bunch for the example, it helped a lot.  I am trying to get the date out of the Axis Scroll Event, I have attached a sample application.

Also, can I use ZoomStyle.Scroll and disable the Y-Axis scrolling so we only scroll X-Axis (but get the condensed scroll viewer (instead of the Map or Zoom areas))

myChart.AxisX.Labels.Format = AxisFormat.Date;

void AxisX_ScrollViewChanged(object sender, EventArgs e)

{

double min = 0;double max = 0;

myChart.AxisX.GetScrollView(

out min, out max);label1.Content = "Axis X min: " + min + ", max: " + max;

try

{

label2.Content = "Axis X min: " + DateTime.FromOADate(min) + ", max: " + DateTime.FromOADate(max);

}

catch (Exception ex)

{

label2.Content = ex.Message;

}

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...