Back to Devexpress

CustomDrawSeriesEventArgsBase.LegendTextVisible Property

corelibraries-devexpress-dot-xtracharts-dot-customdrawserieseventargsbase-92677be8.md

latest2.8 KB
Original Source

CustomDrawSeriesEventArgsBase.LegendTextVisible Property

Gets or sets the text visibility of the legend item of the series whose points are currently being drawn.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public bool LegendTextVisible { get; set; }
vb
Public Property LegendTextVisible As Boolean

Property Value

TypeDescription
Boolean

true , to show the text; otherwise, false.

|

Example

This example demonstrates how you can conditionally customize legend items in the ChartControl.CustomDrawSeriesPoint event handler.

csharp
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;
    }
}
vb
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

CustomDrawSeries

CustomDrawSeriesPoint

Legend Items

CustomDrawSeriesEventArgsBase Class

CustomDrawSeriesEventArgsBase Members

DevExpress.XtraCharts Namespace