Tag Archives: Controls

Displaying Markers on the Chart via Microsoft Chart Controls

01 private void BindData() {
02
03 var exams = new List<Exam>()
04 {
05 new Exam() { Name = "Exam 1", Point = 10 },
06 new Exam() { Name = "Exam 2", Point = 12 },
07 new Exam() { Name = "Exam 3", Point = 15 },
08 new Exam() { Name = "Exam 4", Point = 2 }
09 };
10
11 var series = ExamsChart.Series["ExamSeries"];
12
13 foreach (var exam in exams) {
14
15 var point = new DataPoint();
16 point.SetValueXY(exam.Name, exam.Point);
17
18 point.Label = exam.Point.ToString();
19 series.Points.Add(point);
20 }
21
22 ExamsChart.DataSource = exams;
23 ExamsChart.DataBind();
24 }
Microsoft Chart

Microsoft Chart