Aiming to remove legend entries from an Excel chart from code I tried:
new LegendEntry( new Index() { Val = (UInt32Value)i }, new Delete { Val = true }));where
i
is the index of the entry.
What is strange is that if I open the Excel generated from code, and then manually remove an entry, I see the same code being generated:
C.LegendEntry legendEntry1 = new C.LegendEntry(); C.Index index4 = new C.Index(){ Val = (UInt32Value)1U }; C.Delete delete3 = new C.Delete(){ Val = true }; legendEntry1.Append(index4); legendEntry1.Append(delete3);
But when the Excel is generated, even though the code is there the legend entry is not deleted.
Is there a way to remove legend entries from an Excel chart from code?