Hiding series from the legend


Author
Message
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi Rick,

You need to use:

someSeries.Legend.Mode = SeriesLegendMode.None;

In order to hide the series from the legend.



Best Regards,
Nevron Support Team


Rick Shaban
Rick Shaban
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)
Group: Forum Members
Posts: 6, Visits: 1
I have multiple series in the chart though only need to display a few of them in the legend.

I tried:

RangeM.Legend.DisplayOnLegend.VisibilityMode = VisibilityMode.Hidden

and

RangeM.Legend.DisplayOnLegend.Visible = False

But then get the error "NullReferenceException was unhandled by user code" on this line. "Object reference not set to an instance of an object."

How can this be corrected?


Below is my legend setup:
Dim legend As NLegend = chartControl.Legends(0)
legend.Data.ExpandMode = LegendExpandMode.RowsFixed
legend.Data.RowCount = 1
legend.Dock = Windows.Forms.DockStyle.Top
legend.DockMargins = New NMarginsL(10, 10, 10, 5)
legend.VerticalBorderStyle.Color = NColor.ColorFromString("255,235,241,249")
legend.Margins = New NMarginsL(40, 10, 40, 10)
legend.BoundsMode = BoundsMode.Fit
legend.Data.CellMargins = New NMarginsL(10, 0, 10, 0)
legend.OuterBottomBorderStyle.Color = NColor.ColorFromString("255,235,241,249")
legend.OuterTopBorderStyle.Color = NColor.ColorFromString("255,235,241,249")
legend.OuterLeftBorderStyle.Color = NColor.ColorFromString("255,235,241,249")
legend.OuterRightBorderStyle.Color = NColor.ColorFromString("255,235,241,249")
legend.BoundsMode = BoundsMode.Fit
legend.FillStyle = New NColorFillStyle(NColor.ColorFromString("255,235,241,249"))

Best regards,

Rick
Attachments
Working.png (153 views, 36.00 KB)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search