예제 #1
0
		private ChartMouseEventArgs GetChartMouseEventArgs(object sender, MouseEventArgs e)
		{
			if (_Chart == null || ChartArea == null || PlotArea == null || XAxis == null || YAxis == null)
				return null;

			ChartMouseEventArgs args = new ChartMouseEventArgs();
			args.MouseEventArgs = e;
//j			args.XAxis = XAxis;
//j			args.YAxis = YAxis;
//j			args.ChartArea = ChartArea;
//j			args.PlotArea = PlotArea;
			args.PlotAreaPosition = e.GetPosition(PlotArea);
			args.PlotAreaCoordinate = GetCoordinateFromPosition(args.PlotAreaPosition);
#if NOTUSED //j
			LineSeries ls = null;
			foreach (ISeries series in x_Chart.Series)
				if (series is LineSeries)
					ls = (LineSeries)series;
			if (ls != null && ls.Points != null)
			{
				List<Point> points = ls.Points.ToList();
				Point point = points.Where(p => p.X >= mousePos.X).ElementAtOrDefault(0);
				int index = (points.Contains(point) ? points.IndexOf(point) : -1);
			}
#endif
			return args;
		}
예제 #2
0
		private void OnMouseLeftButtonDown(object sender, ChartMouseEventArgs e)
		{
			_MouseDown = (sender as UIElement).CaptureMouse();
			OnMouseMove(sender, e);
		}
예제 #3
0
		private void OnMouseLeftButtonUp(object sender, ChartMouseEventArgs e)
		{
			_MouseDown = false;
			(sender as UIElement).ReleaseMouseCapture();
		}
예제 #4
0
		private void OnMouseMove(object sender, ChartMouseEventArgs e)
		{
			if (!_MouseDown)
				return;

			PositionVerticalLine(e.PlotAreaPosition);
			Pair coordinate = e.PlotAreaCoordinate;
			JulianDay date = ((DateTime)coordinate.X).ToJulian();
			App.Model.ProfileHolder.Profile.CurrentDate = date;
		}