Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ChartControl.CustomizeStackedBarTotalLabel Event

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

Namespace: DevExpress.XtraCharts

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

NuGet Package: DevExpress.Win.Charts

#Declaration

public event CustomizeStackedBarTotalLabelEventHandler CustomizeStackedBarTotalLabel

#Event Data

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.

#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:

image

chartControl1.CustomizeStackedBarTotalLabel += OnChartCustomizeStackedBarTotalLabel;
//...
private void OnChartCustomizeStackedBarTotalLabel(object sender, CustomizeStackedBarTotalLabelEventArgs e) {
    e.TextColor = (e.TotalValue >= 50) ? Color.Green : Color.Gray;
}
See Also