简体   繁体   English

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

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

I have a syncfusion chart in my winform application. 我的winform应用程序中有一个同步融合图。 I add a series of data. 我添加了一系列数据。 I want to highlight a specific point of the series (let's say the 25th data point of the first series) with a red circle and the "Focus" text. 我想用红色圆圈和“焦点”文本突出显示该系列的特定点(假设第一个系列的第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);

but, the displayed text is stuck to the symbol. 但是,显示的文本将粘贴在符号上。 I would like to add space between the label and the symbol. 我想在标签和符号之间添加空格。 Is there a property I missed ? 有没有我想念的财产?

Thank you 谢谢

Thanks for using Syncfusion Products. 感谢您使用Syncfusion产品。 We have analyzed your query. 我们已经分析了您的查询。 While using the Custom Points the space between the text and the symbol can be provided by using the Alignment property of the Custom points. 使用自定义点时,可以使用自定义点的Alignment属性提供文本和符号之间的空间。 The alignment property is used to align the text in the center, top, topleft , topright ,left ,right ,bottom ,bottomleft ,bottomright and when the symbol is present the RegionUp, RegionDown, RegionCenter will consider the symbol and the align the text accordingly. 对齐属性用于在中心,顶部,顶部左,顶部右,左,右,底部,底部左,底部右对齐文本,当存在符号时,RegionUp,RegionDown,RegionCenter将考虑符号并相应地对齐文本。 When the RegionUp is set to the alignment the space is provided between the symbol and the text 当RegionUp设置为对齐方式时,在符号和文本之间提供空格

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

We have attached the sample for your reference. 我们已附上样本供您参考。 Sample link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/Custom_points-2112217385 样本链接: http : //www.syncfusion.com/downloads/support/directtrac/general/ze/Custom_points-2112217385

Please let us know if you have any concerns. 如果您有任何疑问,请告诉我们。

Regards, 问候,

Deepaa. 迪帕

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM