如何在 Syncfusion 图表中放置 ChartCustomPoint 的标签(winform)

How to place the label of ChartCustomPoint in a Syncfusion Chart (winform)

我的 winform 应用程序中有一个 syncfusion 图表。 我添加了一系列数据。 我想用红色圆圈和 "Focus" 文本突出显示该系列的特定点(比如第一个系列的第 25 个数据点)。

ChartCustomPoint cp = new ChartCustomPoint();
cp.CustomType = ChartCustomPointType.PointFollow;
cp.PointIndex=25;
cp.SeriesIndex=1;
cp.Symbol.Shape = ChartSymbolShape.Circle;
cp.Symbol.Color = Color.Red;
cp.Symbol.Marker.LineInfo.Width = 4;
cp.Alignment = ChartTextOrientation.Up;
cp.Text = "Focus";
chartControl1.CustomPoints.Add(cp);

但是,显示的文本粘在符号上。我想在标签和符号之间添加 space 。 有没有 属性 我错过了?

谢谢

感谢您使用 Syncfusion 产品。 我们已经分析了您的查询。使用自定义点时,可以使用自定义点的对齐 属性 来提供文本和符号之间的 space。 对齐 属性 用于将文本居中对齐,top, topleft , topright ,left ,right ,bottom ,bottomleft ,bottomright 并且当符号出现时 RegionUp, RegionDown, RegionCenter 将考虑符号和相应地对齐文本。 当 RegionUp 设置为对齐方式时,在符号和文本

之间提供 space
       ChartCustomPoint cp1 = new ChartCustomPoint();
       // Point that follows a series point:
       cp1.PointIndex = 2;
       cp1.SeriesIndex = 0;
       cp1.CustomType = ChartCustomPointType.PointFollow;
       cp1.Symbol.Shape = ChartSymbolShape.Circle;
       cp1.Offset = 20;
       cp1.Font.Facename = "Times New Roman";
       cp1.Font.Bold = true;
       cp1.Font.Size = 11f;
       cp1.Symbol.Color = Color.FromArgb(0Xc1, 0X39, 0x2b);
       // Provide space between the symbol and the text
       cp1.Alignment = ChartTextOrientation.RegionUp;
       cp1.Text = "Circle";
       cp1.Symbol.Marker.LineInfo.Width = 4;
       chart.CustomPoints.Add(cp1);

我们已附上样本供您参考。 示例 link:http://www.syncfusion.com/downloads/support/directtrac/general/ze/Custom_points-2112217385

如果您有任何疑虑,请告诉我们。

此致,

迪帕。