none
Modifying chart colors within Theme1.xml in .pptx file RRS feed

  • Question

  • I'm trying to find the line of code where PowerPoint sets the color for the text within a new chart. In fact it's been bugging me for years. 

    I have the know-how to setup the palette and to even add a extra custom palette, and it doesn't seem unreasonable to expect that the Chart text should adopt the same color as my Body text (Dk1) by Default - but it doesn't.

    For some reason, PowerPoint sets the Chart text to be a variant of the Body text color, approx 35% lighter. It doesn't pick this from any other color in the Palette. 

    Can anyone tell me how to preset Chart text on a new chart to be a fixed color, ie. Black ? 

    thanks so much. 

    Monday, December 14, 2015 9:14 PM

Answers

  • Hi Daryl,
    I get your point about multiple chart types and user action needed. And when I say, "part of the product", I really mean that they are features and behavior included in PowerPoint but not dictated by or in contradiction to the file format standard. When PowerPoint emits the chart parts for a new chart, including the chart\style[n].xml, chart\colors[n].xml and chart\chart[n].xml, it is free to provide a built-in "template" if you will, that looks a certain way. The choice to initially modify the luminosity of the text color was a style choice by PowerPoint. Where that template gets the initial color is a question of product feature design, not PresentationML conformance (at this point, I should also state that there may be a way to customize where the text color comes from and whether any transformation appears in the resulting new chart, I just don't happen know what that is right now).

    The ISO/IEC 29500 standard does not prescribe how a new chart should look or whether applications (like PowerPoint) should make new chart templates customizable and how to do that which makes this discussion outside the scope and charter of this forum. This is really a better topic of discussion for the PowerPoint and Office IT Pro forums. They would deal with discussions on deploying and customizing Office products for small and large organizations. Can you please post this question to:

    Office 2013 and Office 365 ProPlus - IT Pro General Discussions

    https://social.technet.microsoft.com/Forums/en-US/home?forum=officeitpro

    There may be some solution neither of us have thought of that is more appropriate for your scenario. 

    Tom

    Wednesday, December 23, 2015 2:17 AM
    Moderator

All replies

  • Hello sir_daryl,

    Thank you for your question. I will be working with you on this issue.

    It appears that you are modifying the markup in the files manually and that you have a simple test case to reproduce the behavior. Is that correct? Would you be able to send that to us? If so, please send it to my attention at dochelp@microsoft.com.

    Thank you,
    Kamil Sykora

    Tuesday, December 15, 2015 2:57 AM
  • Hello Kamil, 

    Any PowerPoint file exhibits this behaviour. You can see if you create a new one...  

    File > New > Blank Presentation

    Layout > Title and Content

    Click on Chart icon > Click OK

    You can see the default chart created has Grey text, whereas the text colour in the template palette is Black. 

    And likewise, if the text colour set in in the template palette was Blue, the chart text would be Light Blue by default.

    This is a problem, I need to be able to control exactly what colour that Chart text is. 

    thanks v much, 

    Daryl 

    Tuesday, December 15, 2015 11:58 AM
  • Hello Daryl,

    Can you clarify if you are inquiring about the interpretation of any of the current XML elements created in the persisted file or just application behavior? Are you trying to interpret the mark-up generated by PowerPoint for interoperability reasons with your own application?

    This forum is for assistance with the Open Specifications protocols listed under 

    https://msdn.microsoft.com/en-us/library/dd208104.aspx

     and in most cases the specifications for the Office products do not cover behavior of the application when the relevant mark-up is not yet stored in the file. For example, in your case, we would typically investigate the mark-up associated with an existing chart on a slide, not a future chart that is not yet created and persisted.

    Thanks,
    Kamil Sykora

    Tuesday, December 15, 2015 1:51 PM
  • Hello Kamil, 

    I am not really enquiring about 'future mark-up' as such. But I was under the impression that existing XML elements may dictate the future mark-up when a chart is initialised - and was enquiring where I might locate and adjust the mark-up relating to text color to be defined in the future chart, and assumed it would be somewhere in the file Theme1.xml 

    To clarify the the reason I am asking... I am creating a PowerPoint template for distribution within a multi-national company and, for branding reasons, there are strict color guidelines.

    I have already created an extra color list within the user palette using the relevant markup, (a:extraClrSchemeLst) BUT we also need to ensure that new charts contain black text on titles and labels - currently PowerPoint will not allow us to control this, it appears to apply a LumMod by default. That is the entry that I hope to locate and amend in my template file. 

    Perhaps, however, this behaviour is drawn from the schemas URL in the the Theme header and not within the mark-up..?

    (a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main")

    If I am therefore in the wrong forum to get assistance for this enquiry, then I apologise - could you redirect me? 

    thank you, Daryl 

    Friday, December 18, 2015 1:28 AM
  • Hello Daryl,

    Thank you for the clarification. If you are generating the mark-up yourself or inquiring about the meaning of the mark-up, this is the correct forum about these questions. So is application (e.g. PowerPoint) behavior as it relates to interpreting the mark-up and following the specification.

    Let me see if I can find any information about this scenario. It might be that the behavior is not described by the specification in which case PowerPoint (or any other presentation engine) is free to generate the new elements as it deems appropriate.

    Thanks,
    Kamil Sykora

    Friday, December 18, 2015 6:59 PM
  • Hi Daryl,

    PowerPoint is pulling the lumMod and lumOff sections from the styles[x].xml parts that it generates for each new chart[x].xml. The code looks like this:

    <cs:chartStyle xmlns:cs="http://schemas.microsoft.com/office/drawing/2012/chartStyle"
                   xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
                   id="201">
      <cs:axisTitle>
        <cs:lnRef idx="0"/>
        <cs:fillRef idx="0"/>
        <cs:effectRef idx="0"/>
        <cs:fontRef idx="minor">
          <a:schemeClr val="tx1">
            <a:lumMod val="65000"/>
            <a:lumOff val="35000"/>
          </a:schemeClr>
        </cs:fontRef>
        <cs:defRPr sz="1330"
                   kern="1200"/>
      </cs:axisTitle>
    

    These are part of the product, not the standard specification and therefore, you will not be able to simply adjust the markup in a .pptx template as you would like.

    What it sounds like you are looking for is a way to create a custom chart style, save it as a template and make that the default. Well, you can modify the chart in PowerPoint to have black title and other formatting and then save it as a template. To save as template, you can right click on the chart frame and select "Save As Template...", giving it a name in the resulting dialog box. It saves it as a .crtx in the correct location.

    When you go to insert a chart, you can now choose from the templates folder and even right click on the chart in the templates folder and select, "Set As Default".

    This should allow new charts to be in the format you want. However, it will require that the template is installed with your .pptx template. You may also need some other install code to make it the default chart template. I know this isn't precisely what you were looking for and perhaps there are more elegant solutions on the end user PowerPoint or developer forums.

    Best regards,
    Tom Jebo
    Microsoft Open Specifications

    Tuesday, December 22, 2015 4:29 AM
    Moderator
  • Hi Tom, 

    Thank you but sadly you've only got as far as I had. The .ctrx only sets one type of chart, needs to be saved locally and requires some effort from the User, so as you say, is not a very elegant solution just to adjust a single parameter. 

    However... when you say "these are part of the product" you mean the Chart package I assume?

    This is my whole point: Where and why is that specification set..?? The chart adopts the PowerPoint color palette as expected when drawing each element of the chart, BUT for the Text it makes a preset color adjustment... so who decided that was a good idea ?!

    Perhaps this is a policy-level enquiry. Can you help me escalate this ? 

    thanks, Daryl 

    Tuesday, December 22, 2015 5:18 PM
  • Hi Daryl,
    I get your point about multiple chart types and user action needed. And when I say, "part of the product", I really mean that they are features and behavior included in PowerPoint but not dictated by or in contradiction to the file format standard. When PowerPoint emits the chart parts for a new chart, including the chart\style[n].xml, chart\colors[n].xml and chart\chart[n].xml, it is free to provide a built-in "template" if you will, that looks a certain way. The choice to initially modify the luminosity of the text color was a style choice by PowerPoint. Where that template gets the initial color is a question of product feature design, not PresentationML conformance (at this point, I should also state that there may be a way to customize where the text color comes from and whether any transformation appears in the resulting new chart, I just don't happen know what that is right now).

    The ISO/IEC 29500 standard does not prescribe how a new chart should look or whether applications (like PowerPoint) should make new chart templates customizable and how to do that which makes this discussion outside the scope and charter of this forum. This is really a better topic of discussion for the PowerPoint and Office IT Pro forums. They would deal with discussions on deploying and customizing Office products for small and large organizations. Can you please post this question to:

    Office 2013 and Office 365 ProPlus - IT Pro General Discussions

    https://social.technet.microsoft.com/Forums/en-US/home?forum=officeitpro

    There may be some solution neither of us have thought of that is more appropriate for your scenario. 

    Tom

    Wednesday, December 23, 2015 2:17 AM
    Moderator
  • Hi Daryl,

    I came across this conversation string when I started searching for an answer to the precise question you were asking about. I know it's been a few years, but I'm wondering if you were able to find a solution to the issue of chart title preset color. I've been searching the link to the MS forum posted above (https://social.technet.microsoft.com/Forums/en-US/home?forum=officeitpro) with absolution no success.

    Thanks,

    Linda


    Tuesday, August 22, 2017 4:24 PM
  • Hi Daryl,

    I came across this conversation string when I started searching for an answer to the precise question you were asking about. I know it's been a few years, but I'm wondering if you were able to find a solution to the issue of chart title preset color. I've been searching the link to the MS forum posted below (https://social.technet.microsoft.com/Forums/en-US/home?forum=officeitpro) with absolution no success.

    Thanks,

    Linda

    Tuesday, August 22, 2017 4:25 PM