Bober02 Posted July 26, 2010 Report Share Posted July 26, 2010 I included the fillowing code to draw crosshair on each mouse move: HitTestResults hitTest = chart1.HitTest(e.GetPosition(chart1)); if (!hitTest.IsInsidePlotArea) return;Axis axisX = chart1.AxisX; Axis axisY = chart1.AxisY;var _x = axisX.PixelToValue(hitTest.PositionRelativeToPlotArea.X); _y = axisY.PixelToValue(hitTest.PositionRelativeToPlotArea.Y); if (_x is decimal) X.Text = _x.ToString(); elseX.Text = _x.ToString();Y.Text = _y.ToString("0.00");FrameworkElement parent = lineH.Parent as FrameworkElement; lineH.Y1 = e.GetPosition(parent).Y; lineH.Y2 = e.GetPosition(parent).Y; lineV.X1 = e.GetPosition(parent).X; lineV.X2 = e.GetPosition(parent).X; and I have two lines added to chart. Now, my tooltip won't show when I hover over point or line. Any idea how to fix this? Quote Link to comment Share on other sites More sharing options...
JuanC Posted July 27, 2010 Report Share Posted July 27, 2010 Does the tooltip fails to work even if the mouse is not directly over the line you are moving? You might want to try setting IsHitTestVisible for this line to false to let mouse events go through it. JuanC Quote Link to comment Share on other sites More sharing options...
Bober02 Posted July 27, 2010 Author Report Share Posted July 27, 2010 If I set the IsHitTestVisible to false then the Hit test stops working (doesn't return values - I believe this is what Visible stands for in this context), and I need to keep it visible... any other ideas? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.