Charts

Home Forums WordprocessingML Charts

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3457
    Eric White
    Keymaster

    Hi,

    Unfortunately, as you know, that is not a feature of DocumentAssembler. It is a great idea, though.

    I recommend the following approach –

    • Include a ‘template’ chart in your template document. You will need to identify this ‘template’ chart in some fashion. One approach that I have used successfully in the past is to insert a paragraph before the chart that contains a specific GUID.
    • Then produce the new document using DocumentAssembler.
    • Write some code that goes into the generated document, and finds the paragraph with the specific GUID.
    • Get your data for the chart in the form that ChartUpdater wants
    • Your code can then find the chart immediately following, and use ChartUpdater to update the data.

    I have added this idea to my list of requested enhancements for DocumentAssembler. But I do not have a schedule for this. Probably not soon, given my current committments.

    Cheers, Eric

    #3464

    Hi Eric

    Thanks for the reply. Since i wrote yesterday I started to modify the ChartUpdater. I can now read my xml and grab the data that I want and put it in the various string arrays (SeriesNames,CategoryNames, Values) required for a chart. The update of the example charts supplied with PowerTools works well.

    I’m now trying to incorporate it into the document i create with document assembler. So what I’ve done is place your sample chart in my template. As far as I can see if just looks for Chart1 tag (need to test that still).

    i’m bit confused about the files being copied from “../../” to the Temp folder, and then the updated chart file is created there (from the copy). Why copy to temp and then create another file as well?

    I’m also facing an issue where the my data doesn’t always have the same amount of values in each series.

    So far so good.

    #3465
    Eric White
    Keymaster

    The answer to your question about why files are copied from “../../” to the Temp folder, and then the updated chart file is created there from the copy is very simple. I do that with almost all my examples, so that when I am manually validating the correct functionality, both the ‘before’ and ‘after’ files are in one location, for my own ease of opening them and seeing if the code worked properly.

    I’m happy you are able to modify the ChartUpdater to get the results you want. In one way, this is the main intention behind the code – to show the basic plumbing of how to do it, and then you can modify as appropriate for your scenario.

    #3466

    Thanks for the explanation!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.