BEN - 2017-05-19

Hello everybody,
I'm using ZedGraph to plot data.
ZedGraph is awesome for ploting many curve with good performance, but takes some time to figure out the tricks.
I make many research on the net but i didn't find any solution on textlabels y axis
I have a Y2axis type linear where i plot my curve, and i haveYaxis type= text where i want to show textlabel
but i want that textlabel[index] is aligned with y2[index] value.
To better understand,
I read data from a database in this format:
Col1 Col2 Col3
A 122.3 05:22:00
B 150.3 06:33:22
C 189.7 06:49:00

I try to edit the scale.majorStep, scale.min, or ScaleFormatEvent but I can not to align textlabel Yaxis with data Y2axis, beacuse y2 axis point are variable.
here is the code

``chart2.GraphPane.CurveList["curve1"].AddPoint((XDate)(Col3[i]), Col2[i]);
myPane02m.Y2Axis.Type = ZedGraph.AxisType.Linear;
myPane02m.YAxis.Type = ZedGraph.AxisType.Text
myPane02m.YAxis.Scale.TextLabels = Col1;
myPane02m.YAxis.Scale.Min = minY;
myPane02m.YAxis.Scale.Max = maxY;
myPane02m.Y2Axis.Scale.Min = minY;
myPane02m.Y2Axis.Scale.Max = maxY;
myPane02m.YAxis.Scale.MajorStep = Offset;
myPane02m.YAxis.Scale.MinorStep = Offset;
myPane02m.Y2Axis.Scale.MajorStep = Offset;
myPane02m.Y2Axis.Scale.MinorStep = Offset;
public string MyCustomFormatter(GraphPane pane, Axis axis, double val, int index)
{
if (index < numberPoint)
{

            string label =  getCol1().ElementAt(index).ToString();
            //MessageBox.Show(label);
            return label;
            //}
        }
        else
        {
            return "";
        }
    }

``
~~~
i want that the textlabel(Column1) is at y Axis and Col2 at y2 axis

It would be awsome if someone found a solution for my problem
thanks

 

Last edit: BEN 2017-05-19