Hide chart legends

Hide chart legends

Forum member · May 5, 2010
How can you hide the legend that is automatically created on charts (specifically, I'm using IndexedLineSeries encase that makes a difference)?

Re: Hide chart legends

Support · May 5, 2010
Hello, Yes, you can hide the legend labels without any problem. You will have to set the Visible property of the legend to false as shown below: MyChart.Legends(0).Visible = False Thanks, ceTe Software Support Team

Re: Hide chart legends

Forum member · May 6, 2010
When I do that it fails saying: CS0118: 'ceTe.DynamicPDF.PageElements.Charting.Chart.Legends' is a 'property' but is used like a 'method' I've tried Legends.Item(0) which fails saying that Legends has no definition for "Item" I've also tried Legend(0), but that fails because Chart has no definition for "Legend" Thoughts?

Re: Hide chart legends

Support · May 6, 2010
Hello, The code we have given in the above forum is for VB.NET. It should work fine if you are using it in VB.NET. Below is the code for C# and Vb.NET. C# Code: chart.Legends[0].Visible = false; Vb.NET Code: MyChart.Legends(0).Visible = False Please make sure that you are importing all the necessary namespaces. ceTe.DynamicPDF.PageElements.Charting ceTe.DynamicPDF.PageElements.Charting.Axes ceTe.DynamicPDF.PageElements.Charting.Series Thanks, ceTe Software Support Team.

Re: Hide chart legends

Forum member · May 6, 2010
That'd be why - I'm in C#. Thanks!