Powerpoint 2007 shows empty rectangle where chart should be RRS feed

  • Question

  • Hi, I have embedded a line chart into a slide using OpenXML SDK 2.0. The line chart is backed by an embedded excel worksheet.

    When the user opens the document she/he should see the line chart but only an empty rectangle at the right place is shown. OpenXML SDK Tool says no validation errors.

    When right-clicking into the rectangle and saying "Edit Data" the embedded excel package will open and suddenly the chart will be displayed correctly in the slide.

    Why is it not displayed correctly upon opening the PPTX document? Am I missing something to be set in the slide or chart?

    Hoping for answers, kind regards, Frank

    Thursday, October 7, 2010 12:50 PM

All replies

  • Hi Frank,

    Do you see any Chart*.xml file when you unzip the package?

    I suggest you insert a sample chart using PowerPoint UI and check the XML it has generated. When you use UI, you will notice that it also adds a Chart*.xml file.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Ankush Microsoft Online Community Support
    • Proposed as answer by Ankush_Bhatia Thursday, October 7, 2010 5:36 PM
    Thursday, October 7, 2010 5:36 PM
  • Hi Ankush, yes, I see all parts that should be necessary for the chart.

    chart.xml is nested into slide1.xml, chart.xml also contains the embedded xlsx package (embeddedpackage.bin). In the slide a graphic frame references the chart. Office 2007 and Office 2003 open the presentation without any moaning but just display an empty/white rectangle shape. Office 2003 also shows an empty rectangle.

    The dialog to select the data shows the series (and opens excel) and even clicking on "cancel" in this dialog will make the chart drawing appear in the slide.

    I have also tried to compare the PPTX that I produce where the chart is not displayed against the version of the same document after right-clicking-to-edit-the-data-and-then-save-it. Except for the strCache and numCache everything is the same.

    What is also funny after that, the X-Axis values are rotated by 45°. Maybe because of the scaling?

    When doing something similar in Excel (writing values into a worksheet) a chart is updated automatically via "Defined Names". With Excel itself it seems to work but extracting (GetContentStream()) the chart from the excel and adding it with feeddata() into powerpoint does not work? Very strange. Thx for further help.

    Kind regards, Frank


    Thursday, October 7, 2010 6:10 PM
  • Hi again,

    it looks like you have to inject the numcache / strcache portions into each series to make things visible.

    When embedding a chart into an XLSX package this is not necessary, Excel seems to be smart enough to draw the chart from the formula references. In Power Point it does not draw the chart when the package is opened.

    So after writing some code to
    - take the defined range names
    - resolve their cell references
    - and transform the row/cell values from excel 
    things are works fine now.


    Monday, November 1, 2010 8:24 AM