Set color of chart element

Modified on Mon, 5 Oct at 1:54 PM

The following feature is a BaseExtensions feature that works on charts. This can be used to change the color of the selected chart element in both Word, PowerPoint and Excel, for which reason it makes sense to use this command as a tool to highlight series in a chart.

We are able to define both RGB colors and accent colors.

In PowerPoint:

Notice that when using this feature in PowerPoint, we need include the native "current selection" menu in the ribbon as well. Otherwise, the feature will not work in PowerPoint as it needs to know what is selected in the chart in order to change the color of the particular element. This is the injected feature:

XML
<Inject showInWord="false" showInExcel="false">
    <control idQ="ChartElementSelector" visible="true"/>
</Inject>

CMD

<Cmd case="BaseExtensions:color-chart-element" color="0,0,0"/>

Parameters

color

Define the color in RGB and use comma as separator. This parameter is required unless the parameter below is used instead.

ThemeColor

Define which theme color that should be applied, e.g. "Accent4". Ensure that you do not define both color parameters.

IncludeMarkerFill

Add true to this parameter if the defined color should also color the markers used in lines charts.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article