I have a DataGridView that displays information that is read from a txt file. My aim is to create a line graph for this data which displays DateTime for the X axis.
Your question seems to have several parts. I'll try to help with each..
The last part in your question is solved like this:
Assuming you have a Chart with the DataPoints set and showing the line, you can use this:
Series S = chart1.Series[0]; // short reference
S.ToolTip = "#VALX{#.##}" + " : " + "#VALY1{#.##}";
to display the x- and y-values as tooltips in a format you like.
See MSDN for a full list of keywords to use in referring to the DataPoints
If you want to display data that are not part of the DataPoint
's data you can instead create individual ToolTips
for each DataPoint
when you add it:
double dx = yourXValue;
double dy = yourYValue;
DataPoint dp = new DataPoint(dx, dy);
dp.ToolTip = yourToolTip;
S.Points.Add(dp);
You will have to create the ToolTip
readily formatted for each DataPoint
!
If other parts are still open, please say so!