Issues with ColorLines in Silverlight
Issues with ColorLines in Silverlight
I'm running into some problems with dragging ColorLines and using drag events to affect other tools on the Silverlight version of the TChart. This is tested against version 4.0.2009.28594
-Setting a RectangleTool's Text or Top and Left coordinates while dragging a ColorLine (ie: in the line's DragLine event handler) causes the ColorLine to disappear (though the mouse cursor indicates that it's still there). Also, it appears to cancel the drag.
-I've found that removing the ColorLine tool while it's dragging (using Chart.Tools.Remove(line)) causes the line to disappear, but causes the mouse cursor to get stuck looking like it's dragging. Is there a cleaner way to do this that doesn't cause the mouse pointer to get messed up?
-Zooming appears to make the ColorLine disappear.
-Not really a ColorLine issue, but I've found that if you drag out a zoom rectangle that is very small in one dimension (say no more than 3-5 pixels) the zoom doesn't happen and the zoom rectangle stays drawn on the chart. You can do this multiple times, though when you do create a zoom area that's large enough it will clean up the old rectangles.
-Setting a RectangleTool's Text or Top and Left coordinates while dragging a ColorLine (ie: in the line's DragLine event handler) causes the ColorLine to disappear (though the mouse cursor indicates that it's still there). Also, it appears to cancel the drag.
-I've found that removing the ColorLine tool while it's dragging (using Chart.Tools.Remove(line)) causes the line to disappear, but causes the mouse cursor to get stuck looking like it's dragging. Is there a cleaner way to do this that doesn't cause the mouse pointer to get messed up?
-Zooming appears to make the ColorLine disappear.
-Not really a ColorLine issue, but I've found that if you drag out a zoom rectangle that is very small in one dimension (say no more than 3-5 pixels) the zoom doesn't happen and the zoom rectangle stays drawn on the chart. You can do this multiple times, though when you do create a zoom area that's large enough it will clean up the old rectangles.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Issues with ColorLines in Silverlight
Hi AndrewP,
Thanks in advance.
I'm not able to reproduce this here. Can you please send us a simple example project we can run "as-is" to reproduce the problem here?-Setting a RectangleTool's Text or Top and Left coordinates while dragging a ColorLine (ie: in the line's DragLine event handler) causes the ColorLine to disappear (though the mouse cursor indicates that it's still there). Also, it appears to cancel the drag.
I've been able to reproduce this one and added it (TW24014417) to the defect list to be fixed for future releases.-I've found that removing the ColorLine tool while it's dragging (using Chart.Tools.Remove(line)) causes the line to disappear, but causes the mouse cursor to get stuck looking like it's dragging. Is there a cleaner way to do this that doesn't cause the mouse pointer to get messed up?
I could also reproduce this one and added it (TW24014418) to the bug list to be fixed.-Zooming appears to make the ColorLine disappear.
Yes, I think it is also a bug which I have added to the list with ID TW24014419.-Not really a ColorLine issue, but I've found that if you drag out a zoom rectangle that is very small in one dimension (say no more than 3-5 pixels) the zoom doesn't happen and the zoom rectangle stays drawn on the chart. You can do this multiple times, though when you do create a zoom area that's large enough it will clean up the old rectangles.
Thanks in advance.
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 |
Re: Issues with ColorLines in Silverlight
Hey,
I've sent an email to support@steema.com with a sample project that illustrates the first issue.
Thanks,
-Andrew
I've sent an email to support@steema.com with a sample project that illustrates the first issue.
Thanks,
-Andrew
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Issues with ColorLines in Silverlight
Hi Andrew,
I'm sorry but this e-mail address is disabled. We don't offer direct e-mail support except for our Pro-Support subscribers. Please attach your project to this thread, post it at our upload page or send it to the news://www.steema.net/steema.public.attachments newsgroup.
Thanks in advance.
I'm sorry but this e-mail address is disabled. We don't offer direct e-mail support except for our Pro-Support subscribers. Please attach your project to this thread, post it at our upload page or send it to the news://www.steema.net/steema.public.attachments newsgroup.
Thanks in advance.
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 |
Re: Issues with ColorLines in Silverlight
Oops sorry about that.
I've posted MtkDemoProjectSilverlight-DragTest.zip to the upload page.
-Andrew
I've posted MtkDemoProjectSilverlight-DragTest.zip to the upload page.
-Andrew
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Issues with ColorLines in Silverlight
Hi Andrew,
Thank you very much. I have also been able to reproduce this now and added the defect to the list with ID TW24014423.
Thank you very much. I have also been able to reproduce this now and added the defect to the list with ID TW24014423.
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:
Re: Issues with ColorLines in Silverlight
Hi Andrew,
After investigating the issue we found that TW24014423 can be resolved doing as in the code below. Can you please check it and confirm it solves the issue at your end?
Thanks in advance.
After investigating the issue we found that TW24014423 can be resolved doing as in the code below. Can you please check it and confirm it solves the issue at your end?
Code: Select all
public Page()
{
InitializeComponent();
InitializeChart();
}
private RectangleTool rect;
private ColorLine line;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Series.Add(typeof(Steema.TeeChart.Silverlight.Styles.FastLine));
tChart1[0].FillSampleValues(200);
rect = new RectangleTool(tChart1.Chart);
rect.Text = "hello!";
rect.AllowResize = false;
tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);
line = new ColorLine(tChart1.Chart);
line.Axis = tChart1.Axes.Left;
line.Value = tChart1[0].YValues.Minimum + 50;
line.DragLine += new EventHandler(line_DragLine);
line.EndDragLine += new ColorLineToolOnDragEventHandler(line_EndDragLine);
tChart1.AutoRepaint = false;
}
private bool Go = false;
void line_EndDragLine(object sender)
{
Go = false;
}
void line_DragLine(object sender, EventArgs e)
{
Go = true;
}
void tChart1_MouseMove(object sender, MouseEventArgs e)
{
if (Go)
{
tChart1.Chart.CancelMouse = false;
Point p = e.GetPosition(tChart1);
rect.Left = tChart1.Axes.Bottom.CalcXPosValue(10);
rect.Top = line.Axis.CalcYPosValue(line.Value);
}
}
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:
Re: Issues with ColorLines in Silverlight
Hello Andrew,
We also found that TW24014419 can be solved setting MinPixels to a low value, for example:
Hope this helps!
We also found that TW24014419 can be solved setting MinPixels to a low value, for example:
Code: Select all
tChart1.Zoom.MinPixels = 2;
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:
Re: Issues with ColorLines in Silverlight
Hello Andrew,
Also TW24014418 works fine with our current TeeChart.Silverlight.dll sources so you may expect this being fixed in next TeeChart for .NET 2009 maintenance release due out very soon.
Also TW24014418 works fine with our current TeeChart.Silverlight.dll sources so you may expect this being fixed in next TeeChart for .NET 2009 maintenance release due out very soon.
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 |
Re: Issues with ColorLines in Silverlight
Sorry for the delay. I've tried the provided workaround for issue TW24014423 with version 4.0.2009.35592, and it doesn't really work. Because AutoRepaint is set to false, zooming and such don't work (the zoom bounding box keeps getting drawn, but the chart doesn't appear to zoom). Trying to move the AutoRepaint to a smarter location and restoring it on mouseup doesn't work; putting it in drag / mousedown event handlers cause the rectangle to not be painted while it gets moved. Finally, with autorepaint set to false initially, then set to false in the drag event and true in the end drag event, the rectangle likewise stops updating its position if the chart is zoomed after dragging the line once.
Re: Issues with ColorLines in Silverlight
Hello AndrewP,
I belive if you could try put manually zoom using events zoom and undonezoom, I check this and I think solve problem and case of rectangle not paint is because you zoomed in the zone where rectangle not appears. Please, check next code works if you want:
If this solution you don't like, please you could said exactly, because you would put autoRepaint=false? and we could try a solution to your problem.
I hope will helps.
Thanks,
I belive if you could try put manually zoom using events zoom and undonezoom, I check this and I think solve problem and case of rectangle not paint is because you zoomed in the zone where rectangle not appears. Please, check next code works if you want:
Code: Select all
public MainPage()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.Silverlight.Tools.RectangleTool rect;
private Steema.TeeChart.Silverlight.Tools.ColorLine line;
private Steema.TeeChart.Silverlight.Styles.Bar bar1;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Series.Add(typeof(Steema.TeeChart.Silverlight.Styles.FastLine));
tChart1[0].FillSampleValues(200);
rect = new Steema.TeeChart.Silverlight.Tools.RectangleTool(tChart1.Chart);
rect.Text ="hello!";
rect.AllowResize = false;
tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);
line = new Steema.TeeChart.Silverlight.Tools.ColorLine(tChart1.Chart);
line.Axis = tChart1.Axes.Left;
line.Value = tChart1[0].YValues.Minimum + 50;
line.DragLine += new EventHandler(line_DragLine);
line.EndDragLine += new Steema.TeeChart.Silverlight.Tools.ColorLineToolOnDragEventHandler(line_EndDragLine);
tChart1.AutoRepaint = false;
tChart1.Zoomed += new EventHandler(tChart1_Zoomed);
tChart1.UndoneZoom += new EventHandler(tChart1_UndoneZoom);
}
void tChart1_UndoneZoom(object sender, EventArgs e)
{
tChart1.Invalidate();
}
void tChart1_Zoomed(object sender, EventArgs e)
{
tChart1.Invalidate();
}
private bool Go = false;
void line_EndDragLine(object sender)
{
Go = false;
}
void line_DragLine(object sender, EventArgs e)
{
Go = true;
}
void tChart1_MouseMove(object sender, MouseEventArgs e)
{
if (Go)
tChart1.Chart.CancelMouse = false;
Point p = e.GetPosition(tChart1);
rect.Left = tChart1.Axes.Bottom.CalcXPosValue(10);
rect.Top = line.Axis.CalcYPosValue(line.Value);
}
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / 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 |
Re: Issues with ColorLines in Silverlight
Hi, Sandra
Thanks for your reply. I've tried this and, while it works for the specific case of zooming, it doesn't work for any of the other cases where redraws are necessary (eg: scrolling instead of zooming, we programatically change the range of data being displayed, we periodically add data to the end of the chart, etc) - we would have to manually account for these as well. Additionally, sometimes the drawing of the rectangle is inconsistent (after zooming and unzooming, it will occasionally not be visible, but zooming and unzooming again will cause it to become visible). Possibly due to the fact that the rectangle moving is taking place in the mousemove instead of the drag, the rectangle appears to get drawn one increment behind where it should. When the mouse is released and the drag is finished, moving the mouse will cause one final rectangle move to happen. We were using AfterDraw for some drawing, and it no longer seems to get called. I'm afraid I don't think this is a very good workaround in general, as it seems to create more problems than it solves.
Thanks for your reply. I've tried this and, while it works for the specific case of zooming, it doesn't work for any of the other cases where redraws are necessary (eg: scrolling instead of zooming, we programatically change the range of data being displayed, we periodically add data to the end of the chart, etc) - we would have to manually account for these as well. Additionally, sometimes the drawing of the rectangle is inconsistent (after zooming and unzooming, it will occasionally not be visible, but zooming and unzooming again will cause it to become visible). Possibly due to the fact that the rectangle moving is taking place in the mousemove instead of the drag, the rectangle appears to get drawn one increment behind where it should. When the mouse is released and the drag is finished, moving the mouse will cause one final rectangle move to happen. We were using AfterDraw for some drawing, and it no longer seems to get called. I'm afraid I don't think this is a very good workaround in general, as it seems to create more problems than it solves.
Re: Issues with ColorLines in Silverlight
Hello Adrew,
Thanks,
It's possible that in this cases, you need do a Invalidate. Please try to put invalidate, because chart drawing.Thanks for your reply. I've tried this and, while it works for the specific case of zooming, it doesn't work for any of the other cases where redraws are necessary (eg: scrolling instead of zooming, we programatically change the range of data being displayed, we periodically add data to the end of the chart, etc) - we would have to manually account for these as well. Additionally, sometimes the drawing of the rectangle is inconsistent (after zooming and unzooming, it will occasionally not be visible, but zooming and unzooming again will cause it to become visible).
Please, you could send us a simple projecte, that we could reproduce your problems here and so we can help you. You could add your project directly in this post.Possibly due to the fact that the rectangle moving is taking place in the mousemove instead of the drag, the rectangle appears to get drawn one increment behind where it should. When the mouse is released and the drag is finished, moving the mouse will cause one final rectangle move to happen. We were using AfterDraw for some drawing, and it no longer seems to get called. I'm afraid I don't think this is a very good workaround in general, as it seems to create more problems than it solves.
Thanks,
Best Regards,
Sandra Pazos / 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 |