Hi,
I have following two classes
public class MyDateObject
{
private double? _value1;
private double? _value2;
private double? _value3;
private DateTime _date;
public double? Value1
{
get
{
return this._value1;
}
set
{
this._value1 = value;
}
}
public double? Value2
{
get
{
return this._value2;
}
set
{
this._value2 = value;
}
}
public double? Value3
{
get
{
return this._value3;
}
set
{
this._value3 = value;
}
}
public DateTime Date
{
get
{
return this._date;
}
set
{
this._date = value;
}
}
public MyDateObject(double? value1, double? value2, double? value3, DateTime date)
{
this._value1 = value1;
this._value2 = value2;
this._value3 = value3;
this._date = date;
}
}
public class MainPageViewModel
{
DateTime baseDate = DateTime.Today.AddDays(-15);
public const int min = 0;
public const int max = 79;
Random r = new Random();
private ObservableCollection<MyDateObject> _chartData;
public ObservableCollection<MyDateObject> ChartData
{
get
{
return this._chartData;
}
set
{
this._chartData = value;
}
}
public MainPageViewModel()
{
this.ChartData = new ObservableCollection<MyDateObject>();
for (int i = 0; i < 30; i++)
{
ChartData.Add(new MyDateObject(r.Next(min, max), r.Next(min, max), r.Next(min, max), baseDate.AddDays(i)));
string str = ChartData[i].Date.ToString();
pivot.str = ChartData[i].Value1;
}
}
}
Now I want to Pivot ChartData on the basis of day to bind to a grid which looks like the following format
...............1 2 3 4
Value 1 6 9 56 78
Value 2 8 51 7 21
Value 3 79 45 57 25