I am trying to create a datalabel with properties shown as in the attachment "fill.jpg" especially the one highlighted in green.
I inspected existing datalabels properties and saw that solidColor.FillType is set to Solid which seems to be the second bullet point in the list and then the solidColor property looks like the one in attachment "solidcolor.jpg".
However when assigning those property to a new datalabel, initially I see the result as expected (transparency is kept together with all the looking of the datalabel) but if I inspect the datalabel it's not showing Solid, it's showing automatic instead.
Now, if I save, close and reopen the file, it doesn't look right and transparency is back to 0 as in postSave.png
Here's the code I am using to set those properties. DatalabelProperties is my custom object where I track existing properties of datalabels retrievining from DefaultCharacterProperties of the label I want to copy from.
- Code: Select all
paragraph.DefaultCharacterProperties.Fill.FillType = dataLabelProperties.FillType;
paragraph.DefaultCharacterProperties.Fill.SolidColor.Color = dataLabelProperties.SolidColor.Color;
I tried setting both at paragraph level as above and at textRange level as below, result is the same.
- Code: Select all
textRange.Fill.SolidColor.SchemeColor= dataLabelProperties.SolidColor.SchemeColor;
textRange.Fill.SolidColor.ColorType = dataLabelProperties.SolidColor.ColorType;
textRange.Fill.SolidColor.Color = dataLabelProperties.SolidColor.Color;
On the textrange I also tried to retain the SchemeColor since it's shown as background1 but it gets cleared as soon as I assign the color and set back to None.
Any hint to solve this issue?
Also the border property is not retained somehow but that doesn't affect the layout. If we could get also a solution to retain without setting it to automatic it would be great!
Thanks in advance,
A