E.G., class with values to load...
public class StackedBarData
{
_private int[] = _barDataPoints = null;
public int[] BarDataPoints
{
// loaded from database call outside of class...
get { return this._barDataPoints ;}
set { this._barDataPoints = value;}
}
_private string _categoryName = "";
public string CategoryName
{
get {return this._categoryName;}
set {this._categoryName = value;}
}
}
the int array has 4 elements.
here is how I setup the the series:
int seriesIndex = 0;
SeriesMapping sm1 = new SeriesMapping();
StackedBarSeriesDefinition d1 = new StackedBarSeriesDefinition();
d1.StackGroupName =
"GroupName";
sm1.SeriesDefinition = d1;
sm1.LegendLabel =
"Show Me the Ints 1"; // name for each item to show...
sm1.CollectionIndex = seriesIndex++; // index into the int array to show data points...
ItemMapping im1 = new ItemMapping("BarDataPoints", DataPointMember.YValue); // contains 4 data elements to show
sm1.ItemMappings.Add(im1);
im1 =
new ItemMapping("CategoryName", DataPointMember.XCategory); // name from class property
sm1.ItemMappings.Add(im1);
(etc for each of the 4 Mapping entries)
// now add to the chart...
List<StackedBarData> listOfDataPoints= new List<StackedBarData>();
int [4] data = new int[] { 55, 22, 63, 74};
StackedBarData barData = new StackedBarData();
barData.CateoryName = "My New Int 1";
barData.BarDataPoints = data;
listOfDataPoints.Add(barData)
// add rest of data points...
this.RadProgramSiteChart.SeriesMappings.Add(sm1);
(etc for the rest of mappings)
// assign to the chart...
this.RadProgramSiteChart.ItemsSource = listOfDataPoints;
When I use this, I get the IEnumerable error (can't find the array of ints)..
Where did I go wrong?
Thanks!
Don