gpt4 book ai didi

asp.net - 如何在 ZedGraph 中的每个点显示标签?

转载 作者:行者123 更新时间:2023-12-04 23:11:09 24 4
gpt4 key购买 nike

如何为 ZedGraph 图表中绘制的每个点显示标签?

最佳答案

由于该网站现在已关闭,这里有一个代码片段来举例说明如何做到这一点:

myLine.GetRange(out other, out other, out minY, out maxY, false, false, myPane);
double Yinterval = Math.Abs(maxY - minY) / 25;
// Loop to add text labels to the points
for (int i = 0; i < tempPoints.Count; i++) {
// Get the pointpair
ZedGraph.PointPair pt = tempPoints[i];
// Create a text label from the Y data value
ZedGraph.TextObj text = new ZedGraph.TextObj(pt.Y.ToString(), pt.X, pt.Y + Yinterval,
ZedGraph.CoordType.AxisXYScale, ZedGraph.AlignH.Left, ZedGraph.AlignV.Center);
text.FontSpec.FontColor = tempHolder.Color;
text.ZOrder = ZedGraph.ZOrder.A_InFront;
// Hide the border and the fill
text.FontSpec.Border.IsVisible = false;
text.FontSpec.Fill.IsVisible = false;
text.FontSpec.Size = 10f;
text.FontSpec.Angle = 45;


string lblString = "name";

Link lblLink = new Link(lblString, "#", "");
text.Link = lblLink;

myPane.GraphObjList.Add(text);
}

关于asp.net - 如何在 ZedGraph 中的每个点显示标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/815556/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com