在轮廓点上显示标记

时间:2016-04-26 12:53:44

标签: c# winforms teechart

我创建一个轮廓并将其添加到图表中,添加带有标签文本的点并订阅GetSeriesMark事件,但不显示文本,并且事件永远不会被触发

Contour contour1 = new Contour();
contour1.IrregularGrid = true;
// 
// contour1
contour1.Brush.Color = Color.FromArgb(68, 102, 163);
contour1.ColorEach = false;
contour1.EndColor = Color.FromArgb(192, 0, 0);
contour1.FillLevels = checkEditFillLevels.Checked;
// 
// 
contour1.Marks.Style = MarksStyles.Label;
contour1.Marks.Visible = true;
//
//
contour1.NumLevels = 8;
contour1.PaletteMin = 0;
contour1.PaletteStep = 0;
contour1.PaletteStyle = PaletteStyles.Pale;
// 
// 
contour1.Pen.Color = Color.FromArgb(192, 192, 192);
contour1.Pen.Style = DashStyle.Dot;
// 
// 
contour1.Pointer.HorizSize = 2;
// 
// 
contour1.Pointer.Pen.Visible = false;
contour1.Pointer.Style = PointerStyles.Rectangle;
contour1.Pointer.VertSize = 2;
contour1.Pointer.Visible = true;
contour1.StartColor = Color.FromArgb(255, 255, 192);
contour1.Title = "contour1";

使用此

添加点数
contour1.Add(x, y, z, "My Point 1");

有没有办法在Contour中的精确点上显示标记,而且还有一种方法只在Contour中的特定点上显示标记(某些点是实际数据,其他点是使用插值来制作的显示轮廓)?

2 个答案:

答案 0 :(得分:1)

我不敢,Contour系列计算并显示来自X,Y和Z点的自定义数组的 isolines 。级别从用户数据自动计算。你想得到什么?您可能对使用注释工具感兴趣。 Here您可以找到有关自定义注释工具定位的示例。

答案 1 :(得分:1)

由于无法在轮廓中标记单个点(请参阅@Narcís Calvet的答案),我最终添加了一个带有标记的点系列。 但是,我仍然只想在图例中显示轮廓水平,而X轴显示它的值而不是点的标记,所以我需要添加以下几行。

tChart1.Legend.LegendStyle = LegendStyles.Values;
tChart1.Legend.Series = _currentContour;
tChart1.Axes.Bottom.Labels.Style = AxisLabelStyle.Value;
相关问题