我很难用英文解释。 目前,我创建了如下图所示的图表。C#快速折线图
与此代码:
public void CreateChart(DataTable chartTable ,string serieName)
{
var chartArea = new ChartArea();
chartArea.AxisX.LabelStyle.Format = "dd/MM/yyy";
chartArea.AxisX.MajorGrid.LineColor = Color.LightGray;
chartArea.AxisY.MajorGrid.LineColor = Color.LightGray;
chartArea.AxisX.LabelStyle.Font = new Font("Consolas", 6);
chartArea.AxisY.LabelStyle.Font = new Font("Consolas", 6);
chart1.ChartAreas.Add(chartArea);
var series = new Series();
series.Name = "TEMP_STACK_BOILER_1";
series.ChartType = SeriesChartType.FastLine;
series.XValueType = ChartValueType.DateTime;
series.YValueType = ChartValueType.Double;
chart1.Series.Add(series);
int lastrow = chartTable.Rows.Count - 4;
string[] xval = new string[lastrow];
int[] yval = new int[lastrow];
// bind the datapoints
chart1.ChartAreas[0].AxisY.Maximum = 1000;
chart1.ChartAreas[0].AxisY.Minimum = 0;
for (int i = 0; i < lastrow; i++)
{
xval[i] = chartTable.Rows[i][1].ToString() + "\r\n" +chartTable.Rows[i][0].ToString() ;
yval[i] = Convert.ToInt32(chartTable.Rows[i][serieName]);
}
chart1.Series[serieName].Points.DataBindXY(xval, yval);
chart1.Invalidate();
}
但我想显示y值如图片 说明我不知道什么叫。 (请参见下图)
这里是我想要的图表:
我试图在谷歌搜索,但仍无法做到这一点。 我真的很抱歉我的英文不好。
希望任何人都可以帮助我。
看看[此](http://stackoverflow.com/questions/13839359/display-values-on-bars-of-a-bar-chart-in-asp-net ) –
非常感谢你,Mong Zhu –