A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
markerBackgroundColor/markerForegroundColor properties in Excel Chart Series return an incorrect value and lack support for a ‘No Fill’/'No Border' option. #4890
I have reported several issues with the charts API, and I am pleased to note that they have been resolved. However, it looks like one particular bug slipped through the gaps.
The API for customizing series markers in Excel charts includes the ability to adjust the marker’s fill color (markerBackgroundColor) and border color (markerForegroundColor). However, there is currently no way to set these colors to transparent, equivalent to the “No Fill” and “No Border” options available in the UI. Unlike VSTO/VBA, where we could assign the msoFalse value, it would be logical to allow the use of the undefined value (similar to other properties) or an empty string for a transparent color.
Additionally, when reading a property, it returns #FEFFFF for no fill/no border values.
Your Environment
Platform: PC desktop, Mac, iOS, Office on the web.
Host: Excel
Office version number: 2408
Operating System: Windows 11
Browser (if using Office on the web): Edge 128
Expected behavior
The markerBackgroundColor and markerForegroundColor properties should allow programmatic use of all possible color values (matching VSTO/VBA), including transparent (No Fill/No Border).
Reading a property and writing it back should preserve the original value without any changes.
Current behavior
No way to set No Fill and No Border values (transparent color).
Reading a property and writing it back changes the value to #FEFFFF.
Click Get Markers Fill Color.
The console displays:
markerBackgroundColor #FEFFFF (type: string)
Click Read And Reapply Markers Color.
Although we assigned a color to the value returned by the API, this action resets it to white (specifically #FEFFFF):
The demo is for markerBackgroundColor, but exactly the same issue occurs with markerForegroundColor.
5./P.S. To ensure there were no undocumented implementations similar to VSTO, I tried assigning undefined to the property as well as an empty string. One can test this by removing the worksheet with the chart (Remove button at the top), adding it once again Load From Base64 and clicking a **Set Marker Color To Empty/Undefined*** button.
Link to live example(s)
See Steps to reproduce
Provide additional details
When you put this issue to a tracker, please include all platforms including iPad, as it used to have fixes applied with a lag.
Context
One cannot use some series markers’ color values. Reading and writing a property breaks the value. API for these properties does not match VSTO/VBA.
I have reported several issues with the charts API, and I am pleased to note that they have been resolved. However, it looks like one particular bug slipped through the gaps.
The API for customizing series markers in Excel charts includes the ability to adjust the marker’s fill color (
markerBackgroundColor
) and border color (markerForegroundColor
). However, there is currently no way to set these colors to transparent, equivalent to the “No Fill” and “No Border” options available in the UI. Unlike VSTO/VBA, where we could assign themsoFalse
value, it would be logical to allow the use of the undefined value (similar to other properties) or an empty string for a transparent color.Additionally, when reading a property, it returns
#FEFFFF
forno fill
/no border
values.Your Environment
Expected behavior
markerBackgroundColor
andmarkerForegroundColor
properties should allow programmatic use of all possible color values (matching VSTO/VBA), including transparent (No Fill/No Border).Current behavior
#FEFFFF
.Steps to reproduce
Use this gist to run the demo in Script Lab: https://gist.github.com/alexuaua/17a95c5dd6b530d7b975aaebf4bfade6
Click Load From Base64.
Click Get Markers Fill Color. The console displays:
Click Read And Reapply Markers Color. Although we assigned a color to the value returned by the API, this action resets it to white (specifically #FEFFFF):
series.markerBackgroundColor = colorValueFunc(series.markerBackgroundColor)
markerBackgroundColor
, but exactly the same issue occurs withmarkerForegroundColor
.5./P.S. To ensure there were no undocumented implementations similar to VSTO, I tried assigning
undefined
to the property as well as an empty string. One can test this by removing the worksheet with the chart (Remove button at the top), adding it once again Load From Base64 and clicking a **Set Marker Color To Empty/Undefined*** button.Link to live example(s)
See Steps to reproduce
Provide additional details
When you put this issue to a tracker, please include all platforms including iPad, as it used to have fixes applied with a lag.
Context
One cannot use some series markers’ color values. Reading and writing a property breaks the value. API for these properties does not match VSTO/VBA.