I'm new to this so I'm hoping to find some direction. I have a plot on in a RadCartesianChart. I want to be able to right-click and capture the location of the mouse at that place. Before we had a double click mouse event and were able to do this:
1.
private
void
ChartSelectionBehavior_SelectionChanged(
object
sender, Telerik.Windows.Controls.ChartView.ChartSelectionChangedEventArgs e)
2.
{
3.
if
(e.AddedPoints.Count > 0)
4.
{
5.
ViewModel.NotePoint = e.AddedPoints[0].DataItem
as
GraphPlots;
6.
}
7.
}
Now I have this:
private
void
standardGraph_MouseRightButtonUp(
object
sender, System.Windows.Input.MouseButtonEventArgs e)
{
//I want to set the NotePoint of the View Model to the location
//of the right-mouse click here
plotContextMenu.Visibility = System.Windows.Visibility.Visible;
}
I can get the location of the MouseButtonEvent, but once I do I'm not sure how to set it as a GraphPlot.
Here's my XML:
01.
<
telerik:RadCartesianChart
Visibility
=
"{Binding StdGraphVisibility}"
02.
x:Name
=
"standardGraph"
03.
Height
=
"500"
04.
Width
=
"1000"
05.
MouseRightButtonDown
=
"mouseRightButtonDown"
06.
MouseRightButtonUp
=
"standardGraph_MouseRightButtonUp"
>
07.
08.
<
telerik:RadContextMenu.ContextMenu
>
09.
10.
<
telerik:RadContextMenu
x:Name
=
"plotContextMenu"
11.
Visibility
=
"Hidden"
>
12.
13.
<
telerik:RadMenuItem
Header
=
"Add note"
14.
x:Name
=
"addNoteMenuItem"
15.
Click
=
"addNoteMenuItem_Click"
/>
16.
17.
</
telerik:RadContextMenu
>
18.
</
telerik:RadContextMenu.ContextMenu
>
19.
20.
<
telerik:RadCartesianChart.Behaviors
>
21.
22.
<
telerik:ChartSelectionBehavior
DataPointSelectionMode
=
"Single"
23.
SelectionChanged
=
"ChartSelectionBehavior_SelectionChanged"
/>
24.
25.
</
telerik:RadCartesianChart.Behaviors
>
26.
27.
<
telerik:RadCartesianChart.HorizontalAxis
>
28.
</
telerik:RadCartesianChart.HorizontalAxis
>
29.
30.
<
telerik:RadCartesianChart.VerticalAxis
>
31.
</
telerik:RadCartesianChart.VerticalAxis
>
32.
33.
<
telerik:RadCartesianChart.Grid
>
34.
35.
<
chartView:CartesianChartGrid
MajorLinesVisibility
=
"Y"
StripLinesVisibility
=
"Y"
/>
36.
37.
</
telerik:RadCartesianChart.Grid
>
38.
39.
<
telerik:RadCartesianChart.Series
>
40.
<
telerik:LineSeries
Stroke
=
"Orange"
41.
CategoryBinding
=
"Category"
42.
ValueBinding
=
"Value"
43.
ItemsSource
=
"{Binding GraphValue}"
>
44.
</
telerik:LineSeries
>
45.
46.
<
telerik:PointSeries
CategoryBinding
=
"Category"
47.
ValueBinding
=
"Value"
48.
ItemsSource
=
"{Binding Notes}"
>
49.
</
telerik:PointSeries
>
50.
</
telerik:RadCartesianChart.Series
>
51.
</
telerik:RadCartesianChart
>