Quantcast
Channel: Open XML Format SDK forum
Viewing all articles
Browse latest Browse all 1288

Delete legend entries from an Excel chart

$
0
0

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?



Viewing all articles
Browse latest Browse all 1288

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>