i can see these code in InitializeComponent function which is generate automaticlly.
Code: Select all
this.bar1.XValues.DataMember = "X";
this.bar1.YValues.DataMember = "Bar";
Code: Select all
Add(new {X=1,Bar=10.22});
Add(new {X=2,Bar=15.65});
class Student {
string name;
int age;
//int weight;
}
so when i want to show my Student class data to chart , which set x axis is "name", set y axis is "age", how i need to do?
I want to code with these style:
this.bar1.XValues.DataMember="name";
this.bar1.XValues.DataMember="age";
....
this.tChart1[0].Add(new Student ('TOM',10));
this.tChart1[0].Add(new Student ('Lily',10));
this.tChart1[0].Add(new Student ('Jack',16));
...