차트를 클릭했을 때
bool isTimerRunning = true;
private void ch_Click(object sender, EventArgs e)
{
if (isTimerRunning)
{
t.Stop();
isTimerRunning = false;
}
else
{
t.Start();
isTimerRunning = true;
}
}
차트 선을 클릭했을 때
private void ch_MouseClick(object sender, MouseEventArgs e)
{
HitTestResult htr = ch.HitTest(e.X, e.Y);
if (htr.ChartElementType==ChartElementType.DataPoint)
{
t.Stop();
string s = string.Format("Count: {0}, ECG: {1}, PPG: {2}",
htr.PointIndex,
ch.Series["ECG"].Points[htr.PointIndex].YValues[0],
ch.Series["PPG"].Points[htr.PointIndex].YValues[0]);
MessageBox.Show(s);
}
}
차트를 zoom할 때
private void ch_SelectionRangeChanged(object sender, CursorEventArgs e)
{
int min = (int)(ch.ChartAreas[0].AxisX.ScaleView.ViewMinimum);
int max = (int)(ch.ChartAreas[0].AxisX.ScaleView.ViewMaximum);
cursorX = min;
datacount = max - min;
}