windowsforms-devexpress-dot-xtracharts-dot-chartcontrol-7045aeed.md
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
public event CustomizeStackedBarTotalLabelEventHandler CustomizeStackedBarTotalLabel
Public Event CustomizeStackedBarTotalLabel As CustomizeStackedBarTotalLabelEventHandler
The CustomizeStackedBarTotalLabel event's data class is CustomizeStackedBarTotalLabelEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Argument | Returns a series point argument value. |
| Text | Gets or sets the total label text. |
| TextColor | Gets or sets the total label’s text color. |
| TotalValue | Returns the total label value. |
The CustomizeStackedBarTotalLabel event allows you to customize the total label appearance based on a specific condition.
This example shows how to paint the Stacked Bar series total label text color depending on the point total value:
chartControl1.CustomizeStackedBarTotalLabel += OnChartCustomizeStackedBarTotalLabel;
//...
private void OnChartCustomizeStackedBarTotalLabel(object sender, CustomizeStackedBarTotalLabelEventArgs e) {
e.TextColor = (e.TotalValue >= 50) ? Color.Green : Color.Gray;
}
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