corelibraries-devexpress-dot-xtracharts-dot-customdrawserieseventargsbase-8f6807cf.md
Gets or sets the visibility of the legend item marker of the series or series point that is currently being painted.
Namespace : DevExpress.XtraCharts
Assembly : DevExpress.XtraCharts.v25.2.dll
NuGet Package : DevExpress.Charts
public bool LegendMarkerVisible { get; set; }
Public Property LegendMarkerVisible As Boolean
| Type | Description |
|---|---|
| Boolean |
true , to show the legend marker; otherwise, false.
|
This example demonstrates how you can conditionally customize legend items in the ChartControl.CustomDrawSeriesPoint event handler.
using System;
using System.Windows.Forms;
using DevExpress.XtraCharts;
// ...
private void chartControl1_CustomDrawSeriesPoint(object sender,
CustomDrawSeriesPointEventArgs e) {
if (Convert.ToDouble(e.SeriesPoint.Values[0]) > 5) {
e.LegendText = "exceeded";
e.LegendTextColor = Color.Red;
}
else {
e.LegendMarkerVisible = false;
e.LegendTextVisible = false;
}
}
Imports System
Imports System.Windows.Forms
Imports DevExpress.XtraCharts
' ...
Private Sub chartControl1_CustomDrawSeriesPoint(ByVal sender As Object, _
ByVal e As CustomDrawSeriesPointEventArgs) Handles chartControl1.CustomDrawSeriesPoint
If Convert.ToDouble(e.SeriesPoint.Values(0)) > 5 Then
e.LegendText = "exceeded"
e.LegendTextColor = Color.Red
Else
e.LegendMarkerVisible = False
e.LegendTextVisible = False
End If
End Sub
See Also
CustomDrawSeriesEventArgsBase Class