Cursors
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi history,
Are you using FastCursor=true?
Are you using FastCursor=true?
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi history,
Thanks for the information.
Thanks for the information.
Nothing else has been done on that field. That's why FastCursor property was implemented.while the regular cursor is choppy in movement when there are a large number of points due to the painting
Yes, this works fine with our current v4 sources and using code below. You can see that only the annotation tool is being repainted if you set FastCursor to false.One of the issues with fastcursor is that you may want to display information on the chart as the cursor is changing. With TeeChart you seem to be only able to paint all the screen and not a portion of the screen.
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.Tools.Annotation anno;
private Rectangle r1;
private void InitializeChart()
{
tChart1.Graphics3D.BufferStyle = Steema.TeeChart.Drawing.BufferStyle.DoubleBuffer;
tChart1.Aspect.View3D = false;
tChart1.Series.Add(typeof(Steema.TeeChart.Styles.Line));
tChart1[0].FillSampleValues(10000);
Steema.TeeChart.Tools.CursorTool cursor;
tChart1.Tools.Add(cursor = new Steema.TeeChart.Tools.CursorTool());
cursor.Style = Steema.TeeChart.Tools.CursorToolStyles.Vertical;
cursor.FollowMouse = true;
cursor.FastCursor = true; //try false
cursor.Change += new Steema.TeeChart.Tools.CursorChangeEventHandler(cursor_Change);
tChart1.Tools.Add(anno = new Steema.TeeChart.Tools.Annotation());
anno.AutoSize = false;
anno.Top = 10;
anno.Left = 10;
anno.Height = 20;
anno.Width = 110;
r1 = anno.Shape.ShapeBounds;
tChart1.AutoRepaint = false;
}
void cursor_Change(object sender, Steema.TeeChart.Tools.CursorChangeEventArgs e)
{
anno.Text = e.XValue.ToString();
tChart1.Invalidate(r1);
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi history,
In the example above you may also be interested in implementing cursor's Change event as shown below when FastCursor=false.
In the example above you may also be interested in implementing cursor's Change event as shown below when FastCursor=false.
Code: Select all
private Rectangle oldRect;
void cursor_Change(object sender, Steema.TeeChart.Tools.CursorChangeEventArgs e)
{
anno.Text = e.XValue.ToString();
tChart1.Invalidate(r1);
Rectangle rect = tChart1.Chart.ChartRect;
Steema.TeeChart.Tools.CursorTool cursor = (Steema.TeeChart.Tools.CursorTool)sender;
int cursorPos = tChart1.Axes.Bottom.CalcPosValue(e.XValue - cursor.Pen.Width/2);
Rectangle r2 = new Rectangle(cursorPos, rect.Top, cursor.Pen.Width, rect.Height);
if (oldRect!=null) tChart1.Invalidate(oldRect);
tChart1.Invalidate(r2);
oldRect = r2;
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |