我正在使用Windows.Forms.DataVisualization.Charting
类来绘制一个简单的字符,绘制一个简单的courb。
我的courb是正确绘制的,但未显示这些点。像点或点所在的十字形。
我尝试使用datapoint.BackImage
,但是什么都没显示。
我确定找到了该图像,因为我将其他图像存储在完全相同的文件夹中,并且在使用相同路径时可以正确读取它们。
输入DataPoint
的代码:
foreach (MesureTaille mesureTaille in tailles)
{
DataPoint point = new DataPoint(mesureTaille.age, mesureTaille.taille);
point.BackImage = string.Concat(
Application.StartupPath.Remove(Application.StartupPath.IndexOf("\\bin\\Debug")),
"/BackgoundImage/dot.png");
Serie_Age_Taille.Points.Add(point);
}
答案 0 :(得分:0)
正如DavidG和TaW所指出的,我需要的是Series.MarkerStyle
:
// This line sets the dots !
Serie_Age_Taille.MarkerStyle = MarkerStyle.Cross;
foreach (MesureTaille mesureTaille in tailles)
{
// And I don't need to do anything on the DataPoints
DataPoint point = new DataPoint(mesureTaille.age, mesureTaille.taille);
Serie_Age_Taille.Points.Add(point);
}