Page 1 of 1

Use CalcXPosValue on Datetime axes

Posted: Wed Apr 12, 2006 8:39 pm
by 9090366
I would like to output a text at location defineded by x which is a datetime and the bottom axes isdatetime.
How can I get that location?
CalcXPosValue accepts double only.
Thanks in advance

Posted: Thu Apr 13, 2006 8:22 am
by narcis
Hi malkarra,

You can easily convert a DateTime value to a double using Microsoft .NET Framework's methods as shown here:

Code: Select all

    private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
    {
      int x = line1.CalcXPosValue(Convert.ToDouble(line1.XValues[5]));
      int y = line1.CalcYPosValue(line1.YValues[5]);
      tChart1.Graphics3D.TextOut(x,y,"My Text");
    }