如何识别T恤图表中的特定数据点并应用样式

时间:2016-09-17 14:41:44

标签: c# teechart

我有一个积分图表,我需要识别一个特定的数据点并应用该样式,下面的代码为所有点设置了样式,但是我需要在Circle中显示几点并且在Cross中显示很少。

代码

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 个答案:

答案 0 :(得分:1)

您可以使用GetPointerStyle事件来修改Point

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;
}