How to add an alert label to the chart?

How to add an alert label to the chart?

Scenario: In a chart, you want to show a label with an alert every time a value surpasses a defined threshold.

Solution: Replicate the procedure in the previous section, using the function:


private void ChangeLabelText(object sender, DevExpress.XtraCharts.CustomDrawSeriesPointEventArgs e) {

      var value = Convert.ToDouble(e.SeriesPoint.Values[0]);

      e.LabelText = "";

      if(value>80)

                  {

                  e.SeriesDrawOptions.Color = Color.FromArgb(4, 110, 4);

                  e.LabelText = "Yeah!";

            }

}

The output will be: