Zedgraph传奇文本位置 [英] Zedgraph legend text location
问题描述
Zedgraph设置为GraphPane.YAxis.Scale.MinAuto = true。
图表中填充了由组合框选择的不同数据。
这显然会导致波动Scale.Min值。
我有一个位于最小值线下的图例。当我选择不同的来源时,这个图例的位置会跳转。
如何指定图例位置,使其无论输入如何都保持在同一位置?
如果比例为零,那将很容易,但随着它的变化,我迷失了'
我是什么尝试过:
这是引用文本放置的代码。
代表UNKNOWN的值是我需要确定的每次。
TextObj Qtr1Text = new TextObj(Q+ Qtr1 +16,dQtrFirst,myPane.YAxis.Scale.Min - UNKNOWN);
或者可能有更好的方法来做这一切?
< blockquote>
最后认为 out 是做的可靠方法 此跨度>。
double yOffset =(myPane.YAxis.Scale.Max - myPane.YAxis.Scale.Min)/ 36 跨度>; // 幻数
TextObj Qtr1Text = new TextObj( Text Value,xLocation,yOffset);
myPane.GraphObjList.Add(Qtr1Text);
值 36 是一个任意数字,应该调整它以得到你想要的负间距。
Zedgraph is set to GraphPane.YAxis.Scale.MinAuto = true.
The graph is populated with differing data chosen by a combobox.
This obviously results in fluctuating Scale.Min values.
I have a legend located under the min value line. As I select differing sources the location of this legend jumps around.
How can I specify the legends position so that it stays in the same place regardless of input?
It would be easy if the scale was zero'd but as it changes, I'm lost'
What I have tried:
This is the code referencing the text placement.
The value representing UNKNOWN is what I need to determine each time.
TextObj Qtr1Text = new TextObj("Q" + Qtr1 + " 16", dQtrFirst, myPane.YAxis.Scale.Min - UNKNOWN);
or maybe there is a much better way of doing all this?
Finally figured out a reliable way to do this. double yOffset = (myPane.YAxis.Scale.Max - myPane.YAxis.Scale.Min) / 36; //magic number TextObj Qtr1Text = new TextObj("Text Value", xLocation, yOffset); myPane.GraphObjList.Add(Qtr1Text); The value 36 is an arbitrary number which should be adjusted to give you the negative spacing you want.
这篇关于Zedgraph传奇文本位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!