I'm working on a chart that contains 4 series: The x-axis is date and the y-axis scales from -10 to 10. Each data point (regardless of series) falls on a different day, although the series do represent different measurements.
I have created the chart that fills from a SQL-query and gotten a vertical line to move horizontally along with the cursor. What I'd like to do next (but have gotten rather stumped) is compare the position of the vertical line with the data points (regardless of which series) and highlight the point visually (and extract the x/y values for dig-down chart information).
I have some ideas about how to step through the different series, but I'm not getting how to create a date-time window (of ~half a day) around my scrolling-vertical-line--how to interface that vertical line with the data-points in the time series. Perhaps I'm just not thinking about the problem correctly?
Here's my code for the mouse move, but I haven't gotten anything working for the portion in question:
private void calCheckChart_MouseMove(object sender, MouseEventArgs e) {
// Set style of cursor over chart, including dotted vertical line
calCheckChart.ChartAreas[0].CursorX.IsUserEnabled = true;
calCheckChart.ChartAreas[0].CursorX.Interval = 0;
calCheckChart.ChartAreas[0].CursorX.LineColor = Color.Black;
calCheckChart.ChartAreas[0].CursorX.LineWidth = 1;
calCheckChart.ChartAreas[0].CursorX.LineDashStyle = ChartDashStyle.Dot;
// Move the vertical line with cursor
Point cursorDate = new Point(e.X);
calCheckChart.ChartAreas[0].CursorX.SetCursorPixelPosition(cursorDate, true);
// ...
}
Thanks for your time looking this over. Any insights are greatly appreciated.