in

Software FX Community

Discuss and find help for all Software FX products.

Programmatically accessing user-drawn annotations?

Last post 08-17-2007 9:28 AM by Pete. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 06-29-2007 9:58 AM

    • Pete
    • Top 75 Contributor
    • Joined on 06-29-2007

    Programmatically accessing user-drawn annotations?

    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);

    Filed under:
  • 06-29-2007 4:33 PM In reply to

    • Frank
    • Top 10 Contributor
    • Joined on 11-30-2006
    • USA

    Re: Programmatically accessing user-drawn annotations?

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

    Francisco Padron
    www.chartfx.com
  • 07-02-2007 8:47 AM In reply to

    • Pete
    • Top 75 Contributor
    • Joined on 06-29-2007

    Re: Programmatically accessing user-drawn annotations?

    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.

     

  • 07-10-2007 7:50 AM In reply to

    • Pete
    • Top 75 Contributor
    • Joined on 06-29-2007

    Re: Programmatically accessing user-drawn annotations?

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

  • 07-12-2007 4:38 PM In reply to

    • JuanC
    • Top 10 Contributor
    • Joined on 03-02-2007

    Re: Programmatically accessing user-drawn annotations?

    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

     

  • 07-23-2007 9:54 AM In reply to

    • Pete
    • Top 75 Contributor
    • Joined on 06-29-2007

    Re: Programmatically accessing user-drawn annotations?

    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?

  • 08-17-2007 9:28 AM In reply to

    • Pete
    • Top 75 Contributor
    • Joined on 06-29-2007

    Re: Programmatically accessing user-drawn annotations?

    I'm still looking for help here.

Page 1 of 1 (7 items)
Copyright 2008 Software FX, Inc.