Skip to main content

How to: Conditionally Hide Series Labels

Handle the ChartControl.CustomDrawSeriesPoint event to conditionally hide series labels. In the event handler, change the CustomDrawSeriesPointEventArgs.LabelText property value to String.Empty to hide a label.


Handling the WebChartControl.CustomDrawSeriesPoint (ChartControlSettings.CustomDrawSeriesPoint) event is necessary to perform the same for the Chart Control for ASP.NET and MVC.

View Example

private void OnCustomDrawSeriesPoint(object sender, CustomDrawSeriesPointEventArgs e) {
    if (e.SeriesPoint.Values[0] < 1) {
        e.LabelText = String.Empty;

The following image demonstrates the result:


See Also