Page 1 of 1
Stop Fastcursor blink
Posted: Fri Dec 03, 2010 4:55 pm
by 15657829
Hi,
I'm using a vertical fastcursor, but when I stop moving the cursor it starts blinking. I don't want the blink, but I can't find a way to turn that off. How can I do that? I just want the cursor to stay fixed at last mouse position.
Thanks,
Ignacio
Re: Stop Fastcursor blink
Posted: Tue Dec 07, 2010 12:03 pm
by 10050769
Hello Nacho,
A solution for you would be that you disable FastCursor property if it don't affect in your application. Also it is not a good solution for you. Please explain us what you want do, so we can try to find a solution.
Thanks,
Re: Stop Fastcursor blink
Posted: Tue Dec 07, 2010 4:16 pm
by 15657829
I cannot disable the fastcursor because the application gets way to slow. This is for a fastline series that gets populated with thousands of datapoints and multiple series. The user then analyzes the chart using a fascursor vertical line moving on the x axis. The line snaps to each data point of the series selected by the user. When the line moves on the x axis I use the SnapChange event to run a binary seach that locates X and Y values for the current datapoint. This is however very cpu intensive and only works fine when I use a fast line. I had a regular line (actually a cross-hair cursor adding a horizontal cursor line tool), but that was too slow. The fast line works fine, but when the user stops moving the mouse the line starts to blink on the last position it was left at. Not sure why, but we don't want that behavior. I just need the line to stop and remain in the lat position it was left at. Is there a way to stop the fastline's blinking behavior once stop moving?
Ignacio
Update: I remember seeing the cursor blinking, but in my latest test it simply disappears after I stop moving the mouse. Not sure what happens, but nevertheless still not the behavior needed. The fast cursor should remain at the last position.
Re: Stop Fastcursor blink
Posted: Fri Dec 10, 2010 11:28 am
by 10050769
Hello Nacho,
We can work in your request and we inform asap.
Thanks,
Re: Stop Fastcursor blink
Posted: Fri Dec 10, 2010 3:27 pm
by 10050769
Hello Nacho,
I Inform that your requests is in wish-list and it will be fixed for next maintenance release. At the moment you can use next workaround that solve your problem:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.Tools.CursorTool tool;
private void InitializeChart()
{
tChart1.Series.Add(typeof(Steema.TeeChart.Styles.Line)).FillSampleValues();
tChart1.Aspect.View3D = false;
tChart1.Tools.Add(tool = new Steema.TeeChart.Tools.CursorTool());
tool.FastCursor = true;
tool.FollowMouse = true;
tool.Style = Steema.TeeChart.Tools.CursorToolStyles.Vertical;
tChart1.AutoRepaint = false;
}
Can you tell if previous code works as you want?
I hope will helps.
Thanks,
Re: Stop Fastcursor blink
Posted: Fri Dec 10, 2010 3:54 pm
by 15657829
Hi Sandra,
Thanks for the sample code. Unfortunately this solution does not work for me because when I turn chart's AutoRepaint property off the user cannot scroll or zoom anymore and trying to do so will also leave fastcursor lines behind.
Btw, I also tried setting a colorline wherever the fastline stops moving, and removing the color line once the mouse continuing moving, but that solution does not work well either. The color line and the fastcursor will be visible when starting to move the move. We are still developing the application, so hopefully the fix will be available before we release. Please let me know if you find any other solution.
Thanks!
Ignacio
Re: Stop Fastcursor blink
Posted: Thu Dec 16, 2010 2:27 pm
by yeray
Hi Ignacio,
You can force a Chart repaint at OnZoom, OnUndoZoom and OnScroll events to continue allowing these features with AutoRepaint=false:
Code: Select all
private Steema.TeeChart.Tools.CursorTool tool;
private void InitializeChart()
{
tChart1.Series.Add(typeof(Steema.TeeChart.Styles.Line)).FillSampleValues(1000);
tChart1.Aspect.View3D = false;
tChart1.Tools.Add(tool = new Steema.TeeChart.Tools.CursorTool());
tool.FastCursor = true;
tool.FollowMouse = true;
tool.Style = Steema.TeeChart.Tools.CursorToolStyles.Vertical;
tChart1.AutoRepaint = false;
tChart1.Scroll += new EventHandler(tChart1_Scroll);
tChart1.Zoomed += new EventHandler(tChart1_Zoomed);
tChart1.UndoneZoom += new EventHandler(tChart1_UndoneZoom);
}
void tChart1_UndoneZoom(object sender, EventArgs e)
{
tChart1.Refresh();
}
void tChart1_Scroll(object sender, EventArgs e)
{
tChart1.Refresh();
}
void tChart1_Zoomed(object sender, EventArgs e)
{
tChart1.Refresh();
}
Re: Stop Fastcursor blink
Posted: Thu Dec 16, 2010 3:51 pm
by 15657829
Hi Yeray,
This solution works great! Thanks! I only had to add one extra event, the "MouseEnter", to refresh the chart in some cases when the previous cursor left on the chart does not go away when returning the mouse to the chart. Nevertheless, again, this solution solves the problem.
Thanks!
Ignacio Salvo
Re: Stop Fastcursor blink
Posted: Thu Dec 16, 2010 4:03 pm
by yeray
Hi Ignacio,
I'm glad to see it!
Hasta luego!