I have fetch data of last 24 hours through stored procedure and I want to plot these data into Point chart. Result of the SP is
on X-Axis : LocationName..... on Y-axis : TrackTimeStamp
I have written following code for plotting point
SqlConnection con = new SqlConnection(@"Data Source=10.182.37.210;Initial Catalog=ECSGCore_QA2;User Id=sa;pwd=sa@1234;");
con.Open();
SqlCommand cmd = new SqlCommand("Sp_GetAssetLocation",con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@AssetId", 32);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
chart1.DataSource = dt;
chart1.ChartAreas["ChartArea1"].AxisX.Title = "Location";
chart1.ChartAreas["ChartArea1"].AxisY.Title = "Time";
//chart1.ChartAreas["ChartArea1"].AxisY.Minimum =
//chart1.ChartAreas["ChartArea1"].AxisY.Maximum =
//chart1.ChartAreas["ChartArea1"].AxisY.Interval =
chart1.Series["Series1"].XValueMember = "LocationName";
chart1.Series["Series1"].YValueMembers = "TrackTimeStamp";
con.Close();
And My result is :
My Questions :
- how to set minimum value like 0:00/12:00 AM and maximum value like 24:00/12:00 PM??
- I want to set interval of 2 hours starting from 12:00 AM to 12:00 PM. How it is possible?
- When I zoom in my chart interval should be change from 2 hour to 1 hour. Is it possible? How to complete my task?
- Location name should be distinct. "Eitra_FirstFloor_2" display 4 times.
- How to make link (hyperlink) of the point. on click event some another information shows.

