private int AddXY(double x, double y, bool nullValue, bool emptyValue) { base.CheckForValidNextX(x); PlotDataPointBiFill plotDataPointBiFill = (PlotDataPointBiFill)base.m_Data.AddNew(); base.DataPointInitializing = true; try { plotDataPointBiFill.X = x; plotDataPointBiFill.Y = y; plotDataPointBiFill.Null = nullValue; plotDataPointBiFill.Empty = emptyValue; } finally { base.DataPointInitializing = false; } base.m_Data.UpdateMinMaxMean(plotDataPointBiFill); if (base.SendXAxisTrackingData) { PlotXAxis xAxis = base.XAxis; xAxis?.Tracking.NewData(x); } if (!nullValue && !emptyValue && base.SendYAxisTrackingData) { PlotYAxis yAxis = base.YAxis; yAxis?.Tracking.NewData(y); } this.DoDataChange(); return(base.m_Data.LastNewDataPointIndex); }
protected override void InternalOnMouseLeft(MouseEventArgs e, bool shouldFocus) { if (shouldFocus) { base.Focus(); } if (this.UserCanMoveDataPoints && this.m_MouseDownDataPointIndex != -1) { base.IsMouseActive = true; this.m_MouseDownDataPoint = this[this.m_MouseDownDataPointIndex]; this.m_MouseDownDataPointX = this.m_MouseDownDataPoint.X; this.m_MouseDownDataPointY = this.m_MouseDownDataPoint.Y; this.m_MouseDownPosX = base.XAxis.PixelsToValue(e); this.m_MouseDownPosY = base.YAxis.PixelsToValue(e); } }
protected override bool InternalHitTest(MouseEventArgs e) { if (base.LegendRectangle.Contains(e.X, e.Y)) { return(true); } this.m_MouseDownDataPointIndex = -1; if (this.IndexDrawStart == -1) { return(false); } if (this.IndexDrawStop == -1) { return(false); } if (this.Markers.Visible) { PlotXAxis xAxis = base.XAxis; PlotYAxis yAxis = base.YAxis; if (xAxis != null && yAxis != null) { int num = this.IndexDrawStart; while (num <= this.IndexDrawStop) { PlotDataPointBiFill plotDataPointBiFill = this[num]; Point point = base.GetPoint(plotDataPointBiFill.X, plotDataPointBiFill.Y); if (!new Rectangle(point.X - this.Markers.Size, point.Y - this.Markers.Size, this.Markers.Size * 2, this.Markers.Size * 2).Contains(e.X, e.Y)) { num++; continue; } this.m_MouseDownDataPointIndex = num; return(true); } } } return(false); }