I am trying to create a line chart, where the Itemmapping is done to two fields of a class and the RadControl.ItemSource is set to a List of objects of that class. The code is as follows:
Here, the class that represents the data point looks as below
The questions are
1. can I do ItemMapping if the fields 'Value' and 'Time' do not belong to the same class?
2. I have two lists of (say) double values, one for the 'Time' values and other for the 'Value' values; how can I perform the item mapping in that case?
SeriesMapping sm =
new
SeriesMapping();
LineSeriesDefinition sd =
new
LineSeriesDefinition();
sm.SeriesDefinition = sd;
sm.ItemMappings.Add(
new
ItemMapping(
"Value"
,DataPointMember.YValue));
sm.ItemMappings.Add(
new
ItemMapping(
"Time"
, DataPointMember.XValue));
LineChart.SeriesMappings.Add(sm);
LineChart.ItemsSource = GenerateLineData2(); // Returns a list of LineData objects ...
Here, the class that represents the data point looks as below
public
class
LineData
{
private
double
_time;
private
double
_value;
public
double
Time
{
get
{
return
_time; }
set
{ _time = value; }
}
public
double
Value
{
get
{
return
_value; }
set
{ _value = value; }
}
}
The questions are
1. can I do ItemMapping if the fields 'Value' and 'Time' do not belong to the same class?
2. I have two lists of (say) double values, one for the 'Time' values and other for the 'Value' values; how can I perform the item mapping in that case?