I want to fix the scale of y-axis to {1, 0.75, 0.50, 0.25, 0, -1, -0.75, -0.50, -0.25}
according to requirement y-axis value will always lie between 1 to -1.
C# code:
string query = "SELECT x,y from Table where DeletionDate is null";
DataTable dt = GetData(query);
double[] x = new double[dt.Rows.Count];
double[] y = new double[dt.Rows.Count];
for (int i = 0; i < dt.Rows.Count; i++)
{
x[i] = Convert.ToDouble(dt.Rows[i][0].ToString());
y[i] = Convert.ToDouble(dt.Rows[i][1].ToString());
}
Chart1.Series[0].Points.DataBindXY(x, y);
Chart1.ChartAreas["ChartArea1"].AxisY.Minimum = -1;
Chart1.ChartAreas["ChartArea1"].AxisY.Maximum = 1;
I want to fix the scale of y-axis as defined above. Whatever the y-axis value coming from DB, it should plot in graph according to scale defined above.
How do achieve it in my above code.
Please reply