Pete Posted June 29, 2007 Report Share Posted June 29, 2007 I am evaluating ChartFX, and am attempting to programmatically get at annotations that were drawn onto the .NET chart by the user through the Annotations toolbar. For testing purposes I'm using the chart's click handler. The other properties of the chart in the event correctly reflect the client side state, but annotations are not there. I tried enabling ViewState on the annotations object. But when I step through the code, EnableViewState = true does not change the state of the object. I'm not sure if this has a bearing on my issue or not. Am I missing something here? ChartFX.WebForms.Annotation.Annotations annots = new ChartFX.WebForms.Annotation.Annotations(); annots.EnableUI = true;annots.ToolBar.Visible = true; annots.Chart = Chart1;annots.EnableViewState = true; // <-- Does not change state Chart1.Extensions.Add(annots); Quote Link to comment Share on other sites More sharing options...
Frank Posted June 29, 2007 Report Share Posted June 29, 2007 What exactly do you want to do? You want to capture in your server a click event in the chart and then from it go through all the annotation objects created by the user? Are you rendering as a .NET Client Control or as an image? Please elaborate on what you need to do with the annotation objects and where (server or client). Quote Link to comment Share on other sites More sharing options...
Pete Posted July 2, 2007 Author Report Share Posted July 2, 2007 The chart is rendered as a .NET Client Control. Yes, in short I'm looking to get annotations drawn by the user on the client side back to the server side. I'm open to your suggestion on implementation details, or letting me know if this is even possible. The user draws an annotation using the exposed ChartFX annotations toolbar. I was hoping there was some sort of server-side event that would fire whenever an annotation was created or updated. Since I didn't find that sort of event in the documentation (does one exist?), I just used the chart click event as a convenient entry point for a callback -- in reality, I'd probably use SFX_SendUserCallback from javascript. The click event fired correctly (so my trust settings are okay), and all of the client-side chart state was correct on the server side, except for the chart.Extensions part where the annotations live. Since the client-side annotations weren't there, I postulated that I needed to enable ViewState for the Annotations; however setting ViewState to true didn't stick. I don't know if that is integral to the solution or not, and don't really care as long as I can get the client side annotations back to the server side. Quote Link to comment Share on other sites More sharing options...
Pete Posted July 10, 2007 Author Report Share Posted July 10, 2007 Any help here? At least give me a "no, you can't get the information about user-drawn annotations on the server side" or a "you should be able to get the annotations, but we don't know why you can't". Quote Link to comment Share on other sites More sharing options...
JuanC Posted July 12, 2007 Report Share Posted July 12, 2007 To minimize amount of data transferred to the server, for postback we serialize the chart using our "Template" settings, this means for example we do not save the chart's data. Unfortunately, the Annotation extension does not serialize the annotation objects when the Data flag is not turned on so unless we modify our code you will have to turn on this flag (e.g. chart1.TemplateContents |= FileContents.Data). Note that in chart with a big number of points this might impact your performance. I have not personally tested this scenario, please let us know if it works, if it doesn't we might be able to find other ways for the annotation to be sent back to the server as it sounds useful. JuanC Quote Link to comment Share on other sites More sharing options...
Pete Posted July 23, 2007 Author Report Share Posted July 23, 2007 Unfortunately, this doesn't keep the extensions around. I tried different combinations of TemplateContents (and FileContents), but that didn't help. On the plus side, I also needed to get TitlesText and Scales, so the tip helped me on a tangential issue. Any other thoughts? Quote Link to comment Share on other sites More sharing options...
Pete Posted August 17, 2007 Author Report Share Posted August 17, 2007 I'm still looking for help here. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.