Back to Devexpress

ChartControl.CustomizeStackedBarTotalLabel Event

windowsforms-devexpress-dot-xtracharts-dot-chartcontrol-7045aeed.md

latest3.3 KB
Original Source

ChartControl.CustomizeStackedBarTotalLabel Event

Occurs when the ChartControl draws total labels for Stacked Bar series.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.UI.dll

NuGet Package : DevExpress.Win.Charts

Declaration

csharp
public event CustomizeStackedBarTotalLabelEventHandler CustomizeStackedBarTotalLabel
vb
Public Event CustomizeStackedBarTotalLabel As CustomizeStackedBarTotalLabelEventHandler

Event Data

The CustomizeStackedBarTotalLabel event's data class is CustomizeStackedBarTotalLabelEventArgs. The following properties provide information specific to this event:

PropertyDescription
ArgumentReturns a series point argument value.
TextGets or sets the total label text.
TextColorGets or sets the total label’s text color.
TotalValueReturns the total label value.

Remarks

The CustomizeStackedBarTotalLabel event allows you to customize the total label appearance based on a specific condition.

Example

This example shows how to paint the Stacked Bar series total label text color depending on the point total value:

csharp
chartControl1.CustomizeStackedBarTotalLabel += OnChartCustomizeStackedBarTotalLabel;
//...
private void OnChartCustomizeStackedBarTotalLabel(object sender, CustomizeStackedBarTotalLabelEventArgs e) {
    e.TextColor = (e.TotalValue >= 50) ? Color.Green : Color.Gray;
}
vb
chartControl1.CustomizeStackedBarTotalLabel += OnChartCustomizeStackedBarTotalLabel
'...
Private Sub OnChartCustomizeStackedBarTotalLabel(ByVal sender As Object, ByVal e As CustomizeStackedBarTotalLabelEventArgs)
    e.TextColor = If(e.TotalValue >= 50, Color.Green, Color.Gray)
End Sub

See Also

CustomizePieTotalLabel

ChartControl Class

ChartControl Members

DevExpress.XtraCharts Namespace