Jump to content
Software FX Community

Chart events not triggered when renderformat=".NET"


Recommended Posts


  Events on the chart like 'UserCommand', 'UserZoom' and 'UserZooming' are not trigerred if the RENDERFORMAT=".NET"...

I use the feature Renderformat=".net" so that the zoom functionality works (zooming into the quadrants of the chart unlike having zoom percentages ranging from 100 to 400).

 Can somebody please help me avoid this trade-off. How can I trigger the zoom events with renderformat=".NET"?



Link to comment
Share on other sites

Do you want to capture these events in the server or in the client (browser)?

Also, notice that in order for the .NET client to generate events at all, and otherwise communicate with JavaScript or the Server, the .NET control must be granted Full Trust in the client. See caspol command for details.

Link to comment
Share on other sites

 Hi Frank,

  Thanks for your response. The events are working fine if the renderformat is anything other than .NET. 

 My purpose: I would like to capture the new (zoomed in) X and Y (x1,y1,x2,y2) co-ordinates when the user zooms into the chart. By capturing the co-ordinates I can display a custom datagrid with additional information about the data points present in that selected co-ordinates.

For the zoom to work - selecting a quadrant by dragging the mouse with left click, the render format has to be .NET. I want to capture the events server side.  As I said the events are generating fine if the renderformat is image, i guess the issue is not with granting full trust or not. I think the reason why the event is not getting triggered server side is because the .NET client control is more like an ActiveX control. But if I am not able to capture the UserZooming event then I think it defies the purpose of having it in the first place.

 Can you Please post a sample that can serve my purpose. Is there a way I can capture the UserZooming event in javascript and do an ajax call to the server?



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.

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