private void Chart_MouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { chart.Cursor = Cursors.Default; mode = mode ^ EChartViewMode.Drag; } }
private void Chart_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { chart.Cursor = Cursors.Hand; mode = mode | EChartViewMode.Drag; startDragPoint = e.Location; } }
private void SetSpyMode(object sender, EventArgs e) { if ((mode & EChartViewMode.Spy) == EChartViewMode.Spy) { mode = mode ^ EChartViewMode.Spy; } else { mode = mode | EChartViewMode.Spy; } }
private void FitToView(object sender, EventArgs e) { mode = EChartViewMode.Auto; chart.BeginInvoke((MethodInvoker)(() => { this.spyBtn.Checked = false; if (chart.ChartAreas.Count > 0) { chart.ChartAreas[0].AxisX.Minimum = double.NaN; chart.ChartAreas[0].AxisX.Maximum = double.NaN; chart.ChartAreas[0].AxisY.Minimum = double.NaN; chart.ChartAreas[0].AxisY.Maximum = double.NaN; chart.ChartAreas[0].AxisX.ScaleView.ZoomReset(0); chart.ChartAreas[0].AxisY.ScaleView.ZoomReset(0); } })); }