2016-09-17 11 views
0

我有一個Points圖表,我需要確定一個特定的數據點並應用樣式,下面的代碼對所有點的樣式進行了設置,但我需要幾點以圓形顯示,少數以十字形顯示。如何識別發球臺上的特定數據點並應用樣式

代碼

Steema.TeeChart.Styles.Points points = new Steema.TeeChart.Styles.Points(frmApplication.DefInstance.VtChart1.Chart) 
points.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle; 
points.Add(xValue, yValue); 

回答

1

可以使用GetPointerStyle事件修改點

points.Add(0, 4); 
points.Add(1, 3); //more point add etc 

//connect to the GetPointerStyle event to modify specific Point Pointerstyle at runtime. 
points.GetPointerStyle += new Steema.TeeChart.Styles.CustomPoint.GetPointerStyleEventHandler(point_GetPointerStyle); 
} 

private void point_GetPointerStyle(Steema.TeeChart.Styles.CustomPoint series, Steema.TeeChart.Styles.GetPointerStyleEventArgs e) 
{ 
    if (e.ValueIndex == 2) 
    e.Style = Steema.TeeChart.Styles.PointerStyles.Cross; 
    else 
    e.Style = Steema.TeeChart.Styles.PointerStyles.Circle; 
}