Hardik Posted December 22, 2008 Report Share Posted December 22, 2008 I have two Y-axis with both having same data for x-axis, I am using the following code But I am not getting proper output of graph and X-axis value are also not been getting displayed as required. Chart1.Data.Clear(); Chart1.Reset(); ConfigureChartFXNifty();sNiftyMax = Convert.ToDouble(dtNifty.Compute("Max(CurPrice)", ""));sNiftyMin = Convert.ToDouble(dtNifty.Compute("Min(CurPrice)", "")); Chart1.Data.Series = 1; Chart1.Data.Points = dtNifty.Rows.Count; Chart1.AxisY.Max = (Convert.ToDouble(sNiftyMax)+50); Chart1.AxisY.Min = ( Convert.ToDouble(sNiftyMin)-50);Chart1.AxisY.Step = (((Convert.ToDouble(sNiftyMax) + 100)-(Convert.ToDouble(sNiftyMin)-50))/4); Chart1.Data.X.Shared = true; int i = 0;for (int j = 0; j < Chart1.Data.Points;j++) { Chart1.Data.Y[i, j] = Convert.ToDouble(dtNifty.Rows[j].ItemArray[1]);dTime = ((dtNifty.Rows[j].ItemArray[0]).ToString()).Remove(5,3).Replace(":",".") ;Chart1.Data.X[i, j] = Double.Parse(dTime); } i = 1; for (int j = 0; j < Chart1.Data.Points-1; j++) {Chart1.Data[i,j]=Convert.ToDouble(dtNifty.Rows[j].ItemArray[2]); } Is something I m missing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.