【问题标题】:How to place the label of ChartCustomPoint in a Syncfusion Chart (winform)如何将 ChartCustomPoint 的标签放置在 Syncfusion 图表中(winform)
【发布时间】:2016-12-02 13:46:24
【问题描述】:

我的 winform 应用程序中有一个同步融合图表。 我添加了一系列数据。 我想用红色圆圈和“焦点”文本突出显示该系列的特定点(比如说第一个系列的第 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);

但是,显示的文本粘在符号上。我想在标签和符号之间添加空格。 有没有我错过的房产?

谢谢

【问题讨论】:

    标签: c# winforms charts syncfusion


    【解决方案1】:

    感谢您使用 Syncfusion 产品。 我们已经分析了您的查询。使用自定义点时,可以使用自定义点的对齐属性来提供文本和符号之间的空间。 对齐属性用于对齐居中、上、左上、右上、左、右、下、左下、右下的文本,当符号出现时,RegionUp、RegionDown、RegionCenter 将考虑符号并相应地对齐文本. 当 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);
    

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

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

    问候,

    Deepaa。

    【讨论】:

    • 嗨,我已经更新了我的代码,以便在符号下方添加标签。不幸的是,标签似乎离符号太近了。我认为偏移值可用于在符号和标签之间添加更多空间。事实并非如此。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-23
    • 1970-01-01
    • 2016-10-14
    相关资源
    最近更新 更多