Page 1 of 1
Issues with ColorLines in Silverlight
Posted: Wed Sep 16, 2009 7:39 pm
by 15653258
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.
Re: Issues with ColorLines in Silverlight
Posted: Thu Sep 17, 2009 8:46 am
by narcis
Hi AndrewP,
-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'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?
-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've been able to reproduce this one and added it (TW24014417) to the defect list to be fixed for future releases.
-Zooming appears to make the ColorLine disappear.
I could also reproduce this one and added it (TW24014418) to the bug list to be fixed.
-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.
Yes, I think it is also a bug which I have added to the list with ID TW24014419.
Thanks in advance.
Re: Issues with ColorLines in Silverlight
Posted: Thu Sep 17, 2009 3:10 pm
by 15653258
Hey,
I've sent an email to
support@steema.com with a sample project that illustrates the first issue.
Thanks,
-Andrew
Re: Issues with ColorLines in Silverlight
Posted: Thu Sep 17, 2009 4:23 pm
by narcis
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.
Re: Issues with ColorLines in Silverlight
Posted: Thu Sep 17, 2009 5:06 pm
by 15653258
Oops sorry about that.
I've posted MtkDemoProjectSilverlight-DragTest.zip to the upload page.
-Andrew
Re: Issues with ColorLines in Silverlight
Posted: Fri Sep 18, 2009 7:44 am
by narcis
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.
Re: Issues with ColorLines in Silverlight
Posted: Tue Sep 22, 2009 2:32 pm
by narcis
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?
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);
}
}
Thanks in advance.
Re: Issues with ColorLines in Silverlight
Posted: Tue Sep 22, 2009 3:01 pm
by narcis
Hello Andrew,
We also found that TW24014419 can be solved setting MinPixels to a low value, for example:
Hope this helps!
Re: Issues with ColorLines in Silverlight
Posted: Tue Sep 22, 2009 3:44 pm
by narcis
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.
Re: Issues with ColorLines in Silverlight
Posted: Tue Nov 10, 2009 10:02 pm
by 15653258
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
Posted: Thu Nov 12, 2009 1:38 pm
by 10050769
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:
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);
}
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,
Re: Issues with ColorLines in Silverlight
Posted: Thu Nov 12, 2009 6:14 pm
by 15653258
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.
Re: Issues with ColorLines in Silverlight
Posted: Fri Nov 13, 2009 12:19 pm
by 10050769
Hello Adrew,
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).
It's possible that in this cases, you need do a Invalidate. Please try to put invalidate, because chart drawing.
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.
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.
Thanks,