none
December CTP Getting Access to Chart object RRS feed

  • Question

  • After upgrading to the December CTP, one of the breaking changes is that there is no more 'Chart' property on the 'ChartSpace' object.  So, code as follows no longer compiles:

     

    ChartPart.ChartSpace.Chart.Title
    
    


    What's the preferred way to get access to the Chart object?  Is it ChartPart.RootElement?

    Thanks!

    -m

    Tuesday, December 15, 2009 2:39 PM

All replies

  • Instead of having Chart as a property I would recommend using the following code:
     ChartPart.ChartSpace.GetFirstChild<Chart>().Title

    Zeyad Rajabi (MS)
    • Proposed as answer by Lu Zhang Wednesday, January 6, 2010 9:11 AM
    Thursday, December 17, 2009 8:41 PM
  • Zeyad,

    Sounds good.  That's what I ended up doing.

    By the way, thanks to you and your team for developing this SDK!  The productivity tool in the December CTP is excellent, and it works quite well with large(ish) documents (70+ pages).

    -m

    Friday, December 18, 2009 3:41 PM
  • Thanks for the feedback.
    Zeyad Rajabi (MS)
    Friday, December 18, 2009 6:41 PM