Draw Cursor Tool behind series lines and marks

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Glenn F. Henriksen
Newbie
Newbie
Posts: 52
Joined: Tue Mar 04, 2003 5:00 am

Draw Cursor Tool behind series lines and marks

Post by Glenn F. Henriksen » Fri Nov 05, 2004 4:30 am

Hi,

The Cursor Tool (vertical in my case) is drawn in front of series lines and marks. Is it possible to send the Cursor Tool behind both of them ?

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Tue Nov 09, 2004 8:44 am

Hi --
The Cursor Tool (vertical in my case) is drawn in front of series lines and marks. Is it possible to send the Cursor Tool behind both of them ?
No, I'm afraid this is not possible; however, you can draw your own cursor tool onto TChart's canvas using one of the canvas events (see the Features Demo -> All Features -> Welcome -> Canvas -> Canvas Events) e.g.

Code: Select all

private void Form1_Load(object sender, System.EventArgs e) {
      line1.FillSampleValues();
      line1.HorizAxis = Steema.TeeChart.Styles.HorizontalAxis.Both;
      tChart1.Axes.Top.Labels.Visible=false;
    }

    private void tChart1_BeforeDrawSeries(object sender, Steema.TeeChart.Drawing.Graphics3D g) {
      if(((System.Drawing.Rectangle)((object)(g.Chart.ChartRect))).Contains(mouseX, mouseY)) {
        g.Pen.Color = Color.Blue;
        g.Line(mouseX, tChart1.Axes.Top.Position, mouseX, tChart1.Axes.Bottom.Position);
      }
    }

    private int mouseX, mouseY;

    private void tChart1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) {
      mouseX = e.X;
      mouseY = e.Y;
      tChart1.Invalidate();
    }
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Post Reply