We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Specify Zoom Range or Even Bounds

Thread ID:





45193 Jun 14,2006 12:59 AM UTC Jun 14,2006 01:20 PM UTC WinForms 1
Tags: Chart
Eric Robishaw
Asked On June 14, 2006 12:59 AM UTC

Given a chart in which the X-Axis represents seconds, ranging from 0 to 300 If I want to make sure the minimum zoom is on a 1 second boundary, I presume I would set the MinZoomFactorX = 1.0 / 300.0 Then, during the chartControl1_VisibleRangeChanged event, I attempt to adjust the ZoomFactor to keep it on a 1 second boundary: double xZoomFactor = chartControl1.PrimaryXAxis.ZoomFactor; if (xZoomFactor != 1) { //convert xZoom into seconds double xZoom = xZoomFactor* _totalSpan.TotalSeconds; //now, lop to even amounts int xZoomEven = (int) Math.Round(xZoom, 0); if (xZoomEven != xZoom) { chartControl1.PrimaryXAxis.ZoomFactor = xZoomEven / _totalSpan.TotalSeconds; } } Doing these 2 things (setting hte ZoomFactor and the minzoom) should, in theory keep my graph from showing fractional portions. However, when I zoom way in , say between points 90 and 120, what I end up with may actually be something like 88.4 to 119.3, exactly what I''m trying to avoid. In other words: I want to make sure that zooms are on, at the very minimum a 1 second (whole number) boundary. I am NOT interested in just setting the format to "0", as this causes the graph values to repeat when zoomed way in (like 87, 87, 88, 89 when the first two values are really 87.4, 87.9, etc...) I DO want the graph to be positioned / zoomed in set minumum intervals. ALSO, let''s say I want the boundary to be at 5 second intervals, instead of 1 second intervals, like when a user zooms in to the 60-90 range, how would I do that? Setting the MinMax range and using a 5 second interval does NOT help, because the graph , when zoomed, may show something like 1.1, 6.1, etc... And the ZoomedRange and VisibleRange properties are READ ONLY!!!! Does this make sense? I''ll provide an example if necessary. THanks

Geetha M [Syncfusion]
Replied On June 14, 2006 01:20 PM UTC

Hi Eric, Thanks for the sample code. Could you please send us a small sample application reproducing this problem so that it would help me to solve it at the earliest? Thanks for your continued interest in Syncfusion products. Regards, Geetha


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon