I have a problem positioning a legend to accommodate changing graph data values.
The Zedgraph Y axis scale is set to auto - GraphPane.YAxis.Scale.MinAuto = true.
The graph is populated with differing data stes as 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?
What I need is to get the axis minimum value and offset it by a negative amount to be just under the graph data.
It would be easy if the scale was zero'd but as it changes, I'm lost...
These pics show how the legend moves with differing data.
This is the code referencing the text placement.
The offset value representing UNKNOWN is what I need to determine each time.
TextObj Qtr1Text = new TextObj("Q" + Qtr1 + " 16", dQtrFirst, myPane.YAxis.Scale.Min - UNKNOWN);
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. 36 gives a spacing like in the top pic, right hand side 'Q3 16'.