Jump to content
Software FX Community

capture zoomed in range at client / server side


maz

Recommended Posts

Hi,

 I have already posted couple of queries on this. Can somebody please help me resolve this issue ASAP. I have the zooming functionality enabled on my chart. I have also disabled scrolling on the chart. I dont want any scrolling on the chart. Now, when the user drags the mouse and selects an area on the chart to zoom in - I would like to capture the range (new x and y co-ordinates) being displayed on the screen. I dont mind capturing the event either before or after the zoom actually occurs. I just want the new set of x1,y1,x2,y2 co-ordinates (range) plotted on the zoomed in chart.

 I have tried capturing the x co-ordinates using chx.AxisX.Labels.Item(0) , chx.AxisX.Labels.Item(1), chx.AxisX.GetScrollView etc and likewise someother properties but none returned the zoomed-In co-ordinates. 

 Thanks,

Maz.

Link to comment
Share on other sites

Hi,

In order to capture these coordinates you can use the UserZooming event which occurs after the user releases the zooming area selector and right before the chart is actually zoomed. This event will provide you (as event arguments) with the new Pixel coordinates of the chart. If you want to get the point coordinates (not pixel coordinates), you can use the PixelToValue method of the Axis class which converts a position in pixels in the chart area to its representation on the respective axis. A couple of things about Client-Side events: - UseClientLoader must be set to false - You must have Full Trust in your .NET permissions (Client Computer - .NET Framework 2.0 Configuration) in order for the client to send events to JavaScript. Take a look at the following sample:<script lang="JavaScript" for="Chart1" event="UserZooming(sender,args)"> alert('Pixel Coordinates: \n\nX1: ' + args.X1 +' and X2: '+ args.X2+ "\n" + 'Y1: ' + args.Y1 + ' and Y2: ' + args.Y2); var chx = document.getElementById("Chart1"); var x1 = chx.AxisX.PixelToValue(args.X1); var x2 = chx.AxisX.PixelToValue(args.X2); var y1 = chx.AxisY.PixelToValue(args.Y1); var y2 = chx.AxisY.PixelToValue(args.Y2); alert('Point Coordinates: \n\nX1: ' + x1 + ' and X2: ' + x2 + "\n" + 'Y1: ' + y1 + ' and Y2: ' + y2); </script> <form id="form1" runat="server"> <div> <chartfx7:Chart ID="Chart1" runat="server" RenderFormat=".Net" UseClientLoader="false" Width="729px"> <Series> <chartfx7:SeriesAttributes></chartfx7:SeriesAttributes> <chartfx7:SeriesAttributes></chartfx7:SeriesAttributes> <chartfx7:SeriesAttributes></chartfx7:SeriesAttributes> </Series> </chartfx7:Chart> </div> </form> </body> </html> Let me know if this is what you want to do. Hopefully this sample will help you. Regards, RandyJ

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...