这个示例展示了如何让 系列点标签 显示自定义信息,特别是根据系列点的取值。
C# | 复制代码 |
---|---|
using System; using System.Windows.Forms; using DevExpress.XtraCharts; // ... private void chartControl1_CustomDrawSeriesPoint(object sender, CustomDrawSeriesPointEventArgs e) { if(e.SeriesPoint.Values[0] > 1) { e.LabelText = "Critical value"; } } |
Visual Basic | 复制代码 |
---|---|
Imports System Imports System.Windows.Forms Imports DevExpress.XtraCharts ' ... Private Sub chartControl1_CustomDrawSeriesPoint(ByVal sender As Object, _ ByVal e As CustomDrawSeriesPointEventArgs) Handles chartControl1.CustomDrawSeriesPoint If e.SeriesPoint.Values(0) > 1 Then e.LabelText = "Critical value" End If End Sub |
在下面的插图中显示了结果。