This is a migrated thread and some comments may be shown as answers.

MarkedZone moving

1 Answer 25 Views
Chart
This is a migrated thread and some comments may be shown as answers.
A K
Top achievements
Rank 1
A K asked on 21 Apr 2011, 02:34 PM
Hi. I need to move some zone on chart (and resize) for changing period (AxisX) and refreshing table with data.
My chart shows parameters for 3 months, and the table on page below can show more data for some selected period (see attached picture).

I`ve done the moving and resizing things with ChartArea_PlotAreaMouseLeftButtonDown + ChartArea_MouseMove + ChartArea_PlotAreaMouseLeftButtonUp events. 

1) Why didn`t you make ChartArea_PlotAreaMouseMove ? Sometimes I need to know AxisX coordinate while moving.
2) I need to change cursor on left border and right border (mouse hover) of marked zone (from Arrow to SizeWE).
I added additional CustomGridLines but Cursor=SizeWE isn`t working on it.
My code:

<telerik:MarkedZone StartX="{Binding Path=StartX}" EndX="{Binding Path=EndX}" 
Background="#200094CD" />

<telerik:CustomGridLine XIntercept="{Binding Path=StartX}"
Visibility="Visible"
Stroke="#AA0094CD"
StrokeThickness="1" Cursor="SizeWE"
/>
<telerik:CustomGridLine XIntercept="{Binding Path=EndX}"
Visibility="Visible"
Stroke="#AA0094CD"
StrokeThickness="1" Cursor="SizeWE"
/>

Any help would be appreciated.

1 Answer, 1 is accepted

Sort by
0
A K
Top achievements
Rank 1
answered on 22 Apr 2011, 12:51 PM
Problem was solved with
List<UIElement> list = VisualTreeHelper.FindElementsInHostCoordinates(e.GetPosition(null), LayoutRoot as UIElement) as List<UIElement>;

on MouseMove event 
and
UIElement el = list.FirstOrDefault(x => (x is Control) && (((Control)x).Name == "sliderLeftBorder" || ((Control)x).Name == "sliderRightBorder"));
if (el != null)
{
(e.OriginalSource as FrameworkElement).Cursor = System.Windows.Input.Cursors.SizeWE;
}
else
{
(e.OriginalSource as FrameworkElement).Cursor = System.Windows.Input.Cursors.Arrow;
}
Tags
Chart
Asked by
A K
Top achievements
Rank 1
Answers by
A K
Top achievements
Rank 1
Share this question
or