Suppose if DB table has x-axis values as below for particular Id:
65
67.5
68.5
70.0
78.5
80.0
81.5
82.5
83.0
83.5
84.0
84.5
85.5
86.5
Then it should select x-axis Min value as 65 (for that particular Id), in below line:
//Chart1.ChartAreas["ChartArea1"].AxisX.Minimum
and it should select x-axis Max value as 86.5 (for that particular Id, in below line:
//Chart1.ChartAreas["ChartArea1"].AxisX.Maximum
These values differ everytime for different Id. ( particular Id has multiple x-
So everytime for particular Id, it should take x-axis Min and Max value from Database.
I tried below code, but its not working.
(Also this code enables MajorGrid = true dont know how. I had set it Enable = false from code behind.)
string query = "SELECT max(x) from Tables where Param_ID= '" + id + "' and DeletionDate is null";
DataTable dt2 = GetData(query);
Chart1.ChartAreas["ChartArea1"].AxisX.Maximum = Convert.ToDouble(dt2);
Please reply how to solve it.