当我尝试结果时,我需要在图表中显示点值
但我想要它像
我的代码是
SqlCommand territorycommand = new SqlCommand("select Terriotry,TotalAcheivmentVol,Forecast from ForecastTotal where Year = '" + DateTime.Now.Year.ToString() + "' and Terriotry = '" + territory + "' and month = '"+Month+"'", conn);
try
{
conn.Open();
mydatareader = territorycommand.ExecuteReader();
while (mydatareader.Read())
{
chart1.Series["TotalAchievment"].Points.AddXY(mydatareader.GetString(0), mydatareader.GetInt32(1));
chart1.Series["Forecast"].Points.AddY(mydatareader.GetInt32(2));
chart1.ChartAreas[0].AxisX.LabelStyle.Interval = 1;
chart1.ChartAreas[0].AxisX.Interval = 1;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
conn.Close();
Run Code Online (Sandbox Code Playgroud)
这可能吗 ?