这个示例展示了如何有条件地隐藏图表的 系列标签。 要这样做,则应接管 ChartControl.CustomDrawSeriesPoint 事件,然后可以修改 CustomDrawSeriesPointEventArgs.LabelText 参量的值。
C# | 复制代码 |
---|
using System;
using System.Windows.Forms;
using DevExpress.XtraCharts;
private void chart_CustomDrawSeriesPoint (object sender, CustomDrawSeriesPointEventArgs e) {
if(e.SeriesPoint[0] < 1) {
e.LabelText = "";
}
}
|
Visual Basic | 复制代码 |
---|
Imports System
Imports System.Windows.Forms
Imports DevExpress.XtraCharts
Private Sub chart_CustomDrawSeriesPoint (ByVal sender As Object, _
ByVal e As CustomDrawSeriesPointEventArgs)
If e.SeriesPoint(0) < 1 Then
e.LabelText = ""
End If
End Sub
|
参阅