Legend.MarkerVisible Property

Specifies whether the legend markers are visible.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v21.2.dll


[OldApi("This is old API. It is recommended to use the MarkerMode property instead.")]
public bool MarkerVisible { get; set; }

Property Value

Type Description

true to display legend markers; otherwise, false.


The following images demonstrate the MarkerVisible property in action.

MarkerVisible = false MarkerVisible = true
MarkerVisible_false MarkerVisible_true

To control the visibility of legend items’ text, use the LegendBase.TextVisible property.

For more information, refer to Legends.


This example demonstrates how a chart’s Legend can be accessed and customized at runtime.

To control whether series, indicators, Constant Lines and Strips should be shown in the legend, use their SeriesBase.ShowInLegend, Indicator.ShowInLegend, ConstantLine.ShowInLegend and Strip.ShowInLegend properties.

Legend legend = chartControl1.Legend;

// Display the chart control's legend.
legend.Visible = true;

// Define its margins and alignment relative to the diagram.
legend.Margins.All = 8;
legend.AlignmentHorizontal = LegendAlignmentHorizontal.RightOutside;
legend.AlignmentVertical = LegendAlignmentVertical.Top;

// Define the layout of items within the legend.
legend.Direction = LegendDirection.LeftToRight;
legend.EquallySpacedItems = true;
legend.HorizontalIndent = 8;
legend.VerticalIndent = 8;
legend.TextVisible = true;
legend.TextOffset = 8;
legend.MarkerVisible = true;
legend.MarkerSize = new Size(20, 20);
legend.Padding.All = 4;

// Define the limits for the legend to occupy the chart's space.
legend.MaxHorizontalPercentage = 50;
legend.MaxVerticalPercentage = 50;

// Customize the legend appearance.
legend.BackColor = Color.Beige;
legend.FillStyle.FillMode = FillMode.Gradient;
((RectangleGradientFillOptions)legend.FillStyle.Options).Color2 = Color.Bisque;

legend.Border.Visible = true;
legend.Border.Color = Color.DarkBlue;
legend.Border.Thickness = 2;

legend.Shadow.Visible = true;
legend.Shadow.Color = Color.LightGray;
legend.Shadow.Size = 2;

// Customize the legend text properties.
legend.Antialiasing = false;
legend.Font = new Font("Arial", 9, FontStyle.Bold);
legend.TextColor = Color.DarkBlue;

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the MarkerVisible property.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also