在ASP.NET中绘制数据图表时,我的图表直观地表示数据值明显不同的相等数据值:
DataTable dt = GetChartData();
double sum = 0;
string[] x = new string[dt.Rows.Count];
double[] y = new double[dt.Rows.Count];
for (int i = 0; i < dt.Rows.Count; i++)
{
x[i] = dt.Rows[i][0].ToString();
sum = Convert.ToDouble(dt.Rows[i][1]);
y[i] = sum;
Chart1.Series[0].XValueMember = x[i];
}
Chart1.Series[0].IsXValueIndexed = true;
// Chart1.DataSource = x;
Chart1.Series[0].IsValueShownAsLabel = true;
Chart1.Series[0].ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.Column;
Chart1.ChartAreas["ChartArea1"].AxisX.Interval = 1;
Chart1.Titles.Add("NewTitle");
Chart1.Titles["NewTitle"].Text = "Rainfall Trend";
List<double> yValues = new List<double>(y);
List<string> xValues = new List<string>(x);
Chart1.Series[0].Points.DataBindXY(xValues, yValues);
为什么图表中没有任何表示相等的值?